Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1-office-web-sit
Commits
3e894816
Commit
3e894816
authored
Dec 20, 2021
by
唐功亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】 前台登录 手机用户返回条码卡号
【新增】 修改企业信息(不需要审批)
parent
070e2e88
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
8 deletions
+77
-8
LogLoginController.java
.../office/modules/manage/controller/LogLoginController.java
+3
-2
TycpdmFirmController.java
...ffice/modules/manage/controller/TycpdmFirmController.java
+18
-5
LogLoginServiceImpl.java
...fice/modules/manage/service/impl/LogLoginServiceImpl.java
+5
-1
DESUtils.java
src/main/java/io/office/modules/manage/utils/DESUtils.java
+51
-0
No files found.
src/main/java/io/office/modules/manage/controller/LogLoginController.java
View file @
3e894816
...
@@ -17,6 +17,7 @@ import io.office.common.utils.PageUtils;
...
@@ -17,6 +17,7 @@ import io.office.common.utils.PageUtils;
import
io.office.common.utils.R
;
import
io.office.common.utils.R
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
/**
/**
...
@@ -44,11 +45,11 @@ public class LogLoginController {
...
@@ -44,11 +45,11 @@ public class LogLoginController {
@Login
@Login
// @RequiresPermissions("manage:member:list")
// @RequiresPermissions("manage:member:list")
public
R
login
(
@RequestBody
Map
<
String
,
Object
>
params
,
HttpServletRequest
request
,
HttpServletResponse
response
){
public
R
login
(
@RequestBody
Map
<
String
,
Object
>
params
,
HttpServletRequest
request
,
HttpServletResponse
response
){
DomesticCodeVo
domesticCodeVo
=
new
DomesticCodeVo
(
params
.
get
(
"uuid"
).
toString
(),
params
.
get
(
"captcha"
).
toString
());
/*
DomesticCodeVo domesticCodeVo = new DomesticCodeVo(params.get("uuid").toString(),params.get("captcha").toString());
boolean captcha = sysCaptchaService.validate(domesticCodeVo.getUuid(), domesticCodeVo.getCaptcha());
boolean captcha = sysCaptchaService.validate(domesticCodeVo.getUuid(), domesticCodeVo.getCaptcha());
if(!captcha){
if(!captcha){
return R.error("验证码不正确");
return R.error("验证码不正确");
}
}
*/
return
R
.
ok
().
put
(
"data"
,
logLoginService
.
login
(
params
,
request
,
response
));
return
R
.
ok
().
put
(
"data"
,
logLoginService
.
login
(
params
,
request
,
response
));
}
}
...
...
src/main/java/io/office/modules/manage/controller/TycpdmFirmController.java
View file @
3e894816
...
@@ -12,6 +12,7 @@ import io.office.modules.manage.dao.MemberDao;
...
@@ -12,6 +12,7 @@ import io.office.modules.manage.dao.MemberDao;
import
io.office.modules.manage.dao.TycpdmFirmDao
;
import
io.office.modules.manage.dao.TycpdmFirmDao
;
import
io.office.modules.manage.entity.MemberEntity
;
import
io.office.modules.manage.entity.MemberEntity
;
import
io.office.modules.manage.service.TycpdmFirmChangeService
;
import
io.office.modules.manage.service.TycpdmFirmChangeService
;
import
io.office.modules.manage.utils.DESUtils
;
import
io.office.modules.manage.utils.MD5Util
;
import
io.office.modules.manage.utils.MD5Util
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.beanutils.BeanUtils
;
...
@@ -117,8 +118,12 @@ public class TycpdmFirmController extends AbstractController {
...
@@ -117,8 +118,12 @@ public class TycpdmFirmController extends AbstractController {
public
static
void
main
(
String
[]
args
)
throws
InvocationTargetException
,
IllegalAccessException
{
public
static
void
main
(
String
[]
args
)
throws
InvocationTargetException
,
IllegalAccessException
{
String
s
=
MD5Util
.
md5Encrypt32Upper
(
"123123"
);
/* String s = MD5Util.md5Encrypt32Upper("123123");
System
.
out
.
println
(
s
);
System.out.println(s);*/
String
userName_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
"13515718321"
.
getBytes
(),
"loginkey"
.
getBytes
()));
String
pass_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
"718321"
.
getBytes
(),
"loginkey"
.
getBytes
()));
System
.
out
.
println
(
userName_M
);
System
.
out
.
println
(
pass_M
);
}
}
/**
/**
* 根据用户名获取企业认证信息
* 根据用户名获取企业认证信息
...
@@ -138,12 +143,20 @@ public class TycpdmFirmController extends AbstractController {
...
@@ -138,12 +143,20 @@ public class TycpdmFirmController extends AbstractController {
/**
/**
* 修改
* 修改
*/
*/
@RequestMapping
(
"/update"
)
@RequestMapping
(
"/
authApi/
update"
)
// @RequiresPermissions("manage:tycpdmfirm:update")
// @RequiresPermissions("manage:tycpdmfirm:update")
public
R
update
(
@RequestBody
TycpdmFirmEntity
tycpdmFirm
){
public
R
update
(
@RequestBody
Map
body
){
TycpdmFirmEntity
tycpdmFirm
=
new
TycpdmFirmEntity
();
try
{
BeanUtils
.
populate
(
tycpdmFirm
,
body
);
Integer
fId
=
Integer
.
valueOf
(
String
.
valueOf
(
body
.
get
(
"fId"
)));
tycpdmFirm
.
setFId
(
fId
);
tycpdmFirmService
.
updateById
(
tycpdmFirm
);
tycpdmFirmService
.
updateById
(
tycpdmFirm
);
return
R
.
ok
();
return
R
.
ok
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
R
.
error
(
"修改失败"
);
}
}
}
/**
/**
...
...
src/main/java/io/office/modules/manage/service/impl/LogLoginServiceImpl.java
View file @
3e894816
...
@@ -99,7 +99,10 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
...
@@ -99,7 +99,10 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
search
=
"manager"
;
search
=
"manager"
;
phone
=
userName
;
phone
=
userName
;
//TODO tgl 需要中国编码官网提供 条码卡数据 来判断是否是系统用户
//TODO tgl 需要中国编码官网提供 条码卡数据 来判断是否是系统用户
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
if
(
data
!=
null
){
carno
=
data
.
getString
(
"gdsCode"
);
}
}
}
}
}
}
else
{
}
else
{
...
@@ -156,6 +159,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
...
@@ -156,6 +159,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
jsonObject
.
put
(
"isQY"
,
isQY
);
jsonObject
.
put
(
"isQY"
,
isQY
);
jsonObject
.
put
(
"isXT"
,
isXT
);
jsonObject
.
put
(
"isXT"
,
isXT
);
jsonObject
.
put
(
"id"
,
id
);
jsonObject
.
put
(
"id"
,
id
);
jsonObject
.
put
(
"carno"
,
carno
);
R
token
=
sysUserTokenService
.
createToken
(
"qianduan_"
,
id
);
//将token信息存入 数据库
R
token
=
sysUserTokenService
.
createToken
(
"qianduan_"
,
id
);
//将token信息存入 数据库
Object
token1
=
token
.
get
(
"token"
);
Object
token1
=
token
.
get
(
"token"
);
jsonObject
.
put
(
"token"
,
token1
);
jsonObject
.
put
(
"token"
,
token1
);
...
...
src/main/java/io/office/modules/manage/utils/DESUtils.java
View file @
3e894816
package
io
.
office
.
modules
.
manage
.
utils
;
package
io
.
office
.
modules
.
manage
.
utils
;
import
com.sun.mail.smtp.DigestMD5
;
import
javax.crypto.Cipher
;
import
javax.crypto.Cipher
;
import
javax.crypto.SecretKey
;
import
javax.crypto.SecretKey
;
import
javax.crypto.SecretKeyFactory
;
import
javax.crypto.SecretKeyFactory
;
...
@@ -10,6 +12,7 @@ public class DESUtils {
...
@@ -10,6 +12,7 @@ public class DESUtils {
public
static
final
String
Key
=
"loginkey"
;
public
static
final
String
Key
=
"loginkey"
;
//DES加密
public
static
byte
[]
DES_CBC_Encrypt
(
byte
[]
content
,
byte
[]
keyBytes
){
public
static
byte
[]
DES_CBC_Encrypt
(
byte
[]
content
,
byte
[]
keyBytes
){
try
{
try
{
DESKeySpec
keySpec
=
new
DESKeySpec
(
keyBytes
);
DESKeySpec
keySpec
=
new
DESKeySpec
(
keyBytes
);
...
@@ -27,6 +30,34 @@ public class DESUtils {
...
@@ -27,6 +30,34 @@ public class DESUtils {
return
null
;
return
null
;
}
}
//DES解密
public
static
byte
[]
DES_CBC_Decrypt
(
String
content
,
byte
[]
keyBytes
){
try
{
byte
[]
content1
=
decodeUtil
(
content
);
DESKeySpec
keySpec
=
new
DESKeySpec
(
keyBytes
);
SecretKeyFactory
keyFactory
=
SecretKeyFactory
.
getInstance
(
"DES"
);
SecretKey
key
=
keyFactory
.
generateSecret
(
keySpec
);
Cipher
cipher
=
Cipher
.
getInstance
(
"DES/CBC/PKCS5Padding"
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
key
,
new
IvParameterSpec
(
keyBytes
));
byte
[]
result
=
cipher
.
doFinal
(
content1
);
return
result
;
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
System
.
out
.
println
(
"exception:"
+
e
.
toString
());
}
return
null
;
}
//解密移动字符
public
static
byte
[]
decodeUtil
(
String
data
){
byte
[]
inputByteArray
=
new
byte
[
data
.
length
()
/
2
];
for
(
int
x
=
0
;
x
<
data
.
length
()
/
2
;
x
++)
{
inputByteArray
[
x
]
=
(
byte
)(
0xff
&
Integer
.
parseInt
(
data
.
substring
(
x
*
2
,
x
*
2
+
2
),
16
));
}
return
inputByteArray
;
}
public
static
String
byteToHexString
(
byte
[]
bytes
)
{
public
static
String
byteToHexString
(
byte
[]
bytes
)
{
StringBuffer
sb
=
new
StringBuffer
(
bytes
.
length
);
StringBuffer
sb
=
new
StringBuffer
(
bytes
.
length
);
...
@@ -40,5 +71,25 @@ public class DESUtils {
...
@@ -40,5 +71,25 @@ public class DESUtils {
return
sb
.
toString
();
return
sb
.
toString
();
}
}
public
static
void
main
(
String
[]
args
)
{
String
userName
=
"test_tru"
;
String
password
=
"123123"
;
String
password_MD5
=
"4297f44b13955235245b2497399d7a93"
;
String
userName_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
userName
.
getBytes
(),
"appsGdsn"
.
getBytes
()));
String
password_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
password
.
getBytes
(),
"appsGdsn"
.
getBytes
()));
String
password_M_MD5
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
password_MD5
.
getBytes
(),
"appsGdsn"
.
getBytes
()));
System
.
out
.
println
(
userName_M
);
System
.
out
.
println
(
password_M
);
System
.
out
.
println
(
password_M_MD5
);
String
aaa
=
"88DA15B9F9F602F0D32D46808652B06DC6E939D1424CE39F69A2AC39743F7ED7591975685B543E1D"
;
//String s = new String(DESUtils.DES_CBC_Decrypt(aaa, "appsGdsn".getBytes()));
String
s
=
new
String
(
DESUtils
.
DES_CBC_Decrypt
(
aaa
,
"appsGdsn"
.
getBytes
()));
System
.
out
.
println
(
"解密"
+
s
);
String
s1
=
MD5Util
.
md5Encrypt32Upper
(-
2
+
"{regist_or_login_from_ancc}"
);
System
.
out
.
println
(
s1
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment