Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Q
queueForTicket_bl
Project
Project
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
mengmeng
queueForTicket_bl
Commits
509fe96d
Commit
509fe96d
authored
Apr 18, 2024
by
Shen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 数据脱敏存储
parent
2d661e00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
ApiLoginController.java
.../src/main/java/io/hmit/controller/ApiLoginController.java
+3
-3
LoginUserHandlerMethodArgumentResolver.java
...hmit/resolver/LoginUserHandlerMethodArgumentResolver.java
+3
-0
No files found.
hmit-api/src/main/java/io/hmit/controller/ApiLoginController.java
View file @
509fe96d
...
...
@@ -157,7 +157,7 @@ public class ApiLoginController {
Map
<
String
,
Object
>
user_map
=
(
Map
<
String
,
Object
>)
userInfoByToken
.
get
(
"personInfo"
);
if
(
user_map
.
get
(
"idNo"
)
!=
null
){
//判断是否已经存在了这条信息
UserEntity
oldUser
=
userService
.
queryByIdnum
(
URLEncoder
.
encode
(
user_map
.
get
(
"idNo"
).
toString
(),
"UTF8"
));
UserEntity
oldUser
=
userService
.
queryByIdnum
(
SMUtil
.
SM4Encrypt
(
URLEncoder
.
encode
(
user_map
.
get
(
"idNo"
).
toString
(),
"UTF8"
)
));
try
{
userMap
.
put
(
"userId"
,
user_map
.
get
(
"userId"
));
...
...
@@ -169,9 +169,9 @@ public class ApiLoginController {
String
idNo
=
user_map
.
get
(
"idNo"
).
toString
();
UserEntity
user
=
new
UserEntity
();
user
.
setUsername
(
user_map
.
get
(
"userName"
).
toString
());
user
.
setMobile
(
URLEncoder
.
encode
(
user_map
.
get
(
"phone"
).
toString
(),
"UTF8"
));
user
.
setMobile
(
SMUtil
.
SM4Encrypt
(
URLEncoder
.
encode
(
user_map
.
get
(
"phone"
).
toString
(),
"UTF8"
)
));
user
.
setPassword
(
URLEncoder
.
encode
(
DigestUtils
.
sha256Hex
(
idNo
),
"UTF8"
));
user
.
setIdCardNo
(
URLEncoder
.
encode
(
idNo
,
"UTF8"
));
user
.
setIdCardNo
(
SMUtil
.
SM4Encrypt
(
URLEncoder
.
encode
(
idNo
,
"UTF8"
)
));
userService
.
insert
(
user
);
userId
=
user
.
getId
();
...
...
hmit-api/src/main/java/io/hmit/resolver/LoginUserHandlerMethodArgumentResolver.java
View file @
509fe96d
package
io
.
hmit
.
resolver
;
import
io.hmit.annotation.LoginUser
;
import
io.hmit.common.utils.sm.SMUtil
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.interceptor.AuthorizationInterceptor
;
import
io.hmit.service.UserService
;
...
...
@@ -41,6 +42,8 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu
//获取用户信息
UserEntity
user
=
userService
.
getUserByUserId
((
Long
)
object
);
user
.
setMobile
(
SMUtil
.
SM4Decrypt
(
user
.
getMobile
()));
user
.
setIdCardNo
(
SMUtil
.
SM4Decrypt
(
user
.
getIdCardNo
()));
return
user
;
}
...
...
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