Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
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
zengtianlai3
ioc_sixiang_license
Commits
c9c45b60
Commit
c9c45b60
authored
Jul 15, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不安全的框架绑定
parent
06640090
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
MaskingController.java
...ava/iot/sixiang/license/controller/MaskingController.java
+6
-2
No files found.
license/src/main/java/iot/sixiang/license/controller/MaskingController.java
View file @
c9c45b60
...
@@ -26,6 +26,11 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -26,6 +26,11 @@ import org.springframework.web.bind.annotation.RestController;
@Api
(
value
=
"数据脱敏"
,
tags
=
{
"数据脱敏"
})
@Api
(
value
=
"数据脱敏"
,
tags
=
{
"数据脱敏"
})
public
class
MaskingController
{
public
class
MaskingController
{
@InitBinder
public
void
initBinder
(
WebDataBinder
binder
)
{
binder
.
setDisallowedFields
(
new
String
[]{
"adminCome"
});
}
@ApiOperation
(
value
=
"数据脱敏"
)
@ApiOperation
(
value
=
"数据脱敏"
)
@PostMapping
(
"/desensitize"
)
@PostMapping
(
"/desensitize"
)
public
ResResult
<
MaskingVo
>
encrypt
(
@RequestBody
MaskingVo
maskingVo
)
{
public
ResResult
<
MaskingVo
>
encrypt
(
@RequestBody
MaskingVo
maskingVo
)
{
...
@@ -40,9 +45,8 @@ public class MaskingController {
...
@@ -40,9 +45,8 @@ public class MaskingController {
MaskingVo
vo
=
new
MaskingVo
();
MaskingVo
vo
=
new
MaskingVo
();
vo
.
setUserName
(
ESAPI
.
encoder
().
encodeForHTML
(
CommonUtil
.
nameDesensitization
(
maskingVo
.
getUserName
())));
vo
.
setUserName
(
ESAPI
.
encoder
().
encodeForHTML
(
CommonUtil
.
nameDesensitization
(
maskingVo
.
getUserName
())));
vo
.
setIdCard
(
ESAPI
.
encoder
().
encodeForHTML
(
CommonUtil
.
idCardEncrypt
(
maskingVo
.
getIdCard
()
)));
vo
.
setIdCard
(
CommonUtil
.
idCardEncrypt
(
maskingVo
.
getIdCard
(
)));
return
ResResult
.
success
().
goRecord
(
vo
);
return
ResResult
.
success
().
goRecord
(
vo
);
}
}
}
}
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