Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
d9b999bb
Commit
d9b999bb
authored
Oct 29, 2019
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
驼峰命名
parent
a95181e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
InnerController.java
...tgroup/xyqb/controller/internal/user/InnerController.java
+4
-4
AesUtil.java
src/main/java/cn/quantgroup/xyqb/util/AesUtil.java
+2
-2
TestJdk8.java
src/test/java/common/TestJdk8.java
+2
-3
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/InnerController.java
View file @
d9b999bb
...
...
@@ -1371,7 +1371,7 @@ public class InnerController implements IBaseController {
if
(
null
!=
content
)
{
content
=
content
.
replaceAll
(
" "
,
"+"
);
}
String
str
=
A
ES
Util
.
decryptAfterBase64Decode
(
content
,
Constants
.
AES_KEY
);
String
str
=
A
es
Util
.
decryptAfterBase64Decode
(
content
,
Constants
.
AES_KEY
);
if
(
null
==
str
||
!
str
.
equals
(
phoneNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"解密有误"
,
null
);
}
...
...
@@ -1432,9 +1432,9 @@ public class InnerController implements IBaseController {
if
(
null
!=
content
)
{
content
=
content
.
replaceAll
(
" "
,
"+"
);
}
String
str
=
A
ES
Util
.
decryptAfterBase64Decode
(
content
,
Constants
.
AES_KEY
);
String
str
=
A
es
Util
.
decryptAfterBase64Decode
(
content
,
Constants
.
AES_KEY
);
if
(
null
==
str
||
!
str
.
equals
(
phoneNo
))
{
log
.
info
(
"[forbiddenUserOrNot][禁用或激活用户]:解密有误, phoneNo:{},aes:{}"
,
phoneNo
,
A
ES
Util
.
encryptAndBase64Encode
(
phoneNo
,
Constants
.
AES_KEY
));
log
.
info
(
"[forbiddenUserOrNot][禁用或激活用户]:解密有误, phoneNo:{},aes:{}"
,
phoneNo
,
A
es
Util
.
encryptAndBase64Encode
(
phoneNo
,
Constants
.
AES_KEY
));
return
JsonResult
.
buildErrorStateResult
(
"解密有误"
,
null
);
}
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
...
...
@@ -1472,7 +1472,7 @@ public class InnerController implements IBaseController {
if
(
null
!=
content
)
{
content
=
content
.
replaceAll
(
" "
,
"+"
);
}
String
str
=
A
ES
Util
.
decryptAfterBase64Decode
(
content
,
Constants
.
AES_KEY
);
String
str
=
A
es
Util
.
decryptAfterBase64Decode
(
content
,
Constants
.
AES_KEY
);
if
(
null
==
str
||
!
str
.
equals
(
userId
.
toString
()))
{
return
JsonResult
.
buildErrorStateResult
(
"解密有误"
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/util/A
ES
Util.java
→
src/main/java/cn/quantgroup/xyqb/util/A
es
Util.java
View file @
d9b999bb
...
...
@@ -15,7 +15,7 @@ import javax.crypto.spec.SecretKeySpec;
* @version 1.0
*/
@Slf4j
public
class
A
ES
Util
{
public
class
A
es
Util
{
/**
* KEY算法
...
...
@@ -60,7 +60,7 @@ public class AESUtil {
*/
private
static
byte
[]
decryptAfterBase64DecodeToByte
(
String
data
,
String
key
)
{
try
{
if
(
key
==
null
||
""
.
equals
(
key
.
trim
().
length
()
))
{
if
(
StringUtils
.
isBlank
(
key
))
{
return
null
;
}
byte
[]
raw
=
key
.
getBytes
(
DATA_ENCODING
);
...
...
src/test/java/common/TestJdk8.java
View file @
d9b999bb
...
...
@@ -2,12 +2,11 @@ package common;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Random
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.util.A
ES
Util
;
import
cn.quantgroup.xyqb.util.A
es
Util
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.RandomStringUtils
;
import
org.junit.Assert
;
...
...
@@ -39,7 +38,7 @@ public class TestJdk8 {
@Test
public
void
wechatContent
()
{
String
userId
=
String
.
valueOf
(
50963791
);
String
content
=
A
ES
Util
.
encryptAndBase64Encode
(
userId
,
Constants
.
AES_KEY
);
String
content
=
A
es
Util
.
encryptAndBase64Encode
(
userId
,
Constants
.
AES_KEY
);
log
.
info
(
"50963791:{}"
,
content
);
}
...
...
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