记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
b6dc972f
Commit
b6dc972f
authored
Aug 19, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:设置安全密码校验逻辑调整;
parent
461e0920
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
23 deletions
+15
-23
GoblinSmsController.java
...uidnet/service/goblin/controller/GoblinSmsController.java
+4
-10
GoblinUserSafeController.java
...t/service/goblin/controller/GoblinUserSafeController.java
+11
-13
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinSmsController.java
View file @
b6dc972f
...
@@ -76,17 +76,11 @@ public class GoblinSmsController {
...
@@ -76,17 +76,11 @@ public class GoblinSmsController {
public
ResponseDto
<
Object
>
checkVerificationCode
(
@Pattern
(
regexp
=
"\\d{6}"
,
message
=
"验证码格式有误"
)
@RequestParam
String
code
)
{
public
ResponseDto
<
Object
>
checkVerificationCode
(
@Pattern
(
regexp
=
"\\d{6}"
,
message
=
"验证码格式有误"
)
@RequestParam
String
code
)
{
String
mobile
=
(
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
);
String
mobile
=
(
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
);
if
(!
LnsEnum
.
ENV
.
prod
.
name
().
equals
(
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)))
{
if
(!
LnsEnum
.
ENV
.
prod
.
name
().
equals
(
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)))
{
if
(
CurrentUtil
.
GRAY_LOGIN_SMS_CODE
.
equals
(
code
))
{
if
(
CurrentUtil
.
GRAY_LOGIN_SMS_CODE
.
equals
(
code
))
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
}
String
smsCodeByMobile
=
goblinRedisUtils
.
getSmsCodeByMobile
(
mobile
);
String
smsCodeByMobile
=
goblinRedisUtils
.
getSmsCodeByMobile
(
mobile
);
if
(
null
==
smsCodeByMobile
)
{
if
(
null
==
smsCodeByMobile
)
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140018"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140018"
));
}
return
smsCodeByMobile
.
equals
(
code
)
?
ResponseDto
.
success
()
:
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140019"
));
if
(
smsCodeByMobile
.
equals
(
code
))
{
return
ResponseDto
.
success
();
}
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140019"
));
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinUserSafeController.java
View file @
b6dc972f
...
@@ -21,6 +21,7 @@ import org.springframework.core.env.Environment;
...
@@ -21,6 +21,7 @@ import org.springframework.core.env.Environment;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
import
javax.validation.constraints.Size
;
...
@@ -52,22 +53,19 @@ public class GoblinUserSafeController {
...
@@ -52,22 +53,19 @@ public class GoblinUserSafeController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"验证码"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"验证码"
),
})
})
@PostMapping
(
value
=
{
"passwd/set"
})
@PostMapping
(
value
=
{
"passwd/set"
})
public
ResponseDto
<
Object
>
setSecurityCode
(
@Size
(
min
=
32
,
max
=
32
,
message
=
"安全密码无效"
)
@RequestParam
String
passwd
,
public
ResponseDto
<
Object
>
setSecurityCode
(
@
NotBlank
(
message
=
"安全密码不能为空"
)
@
Size
(
min
=
32
,
max
=
32
,
message
=
"安全密码无效"
)
@RequestParam
String
passwd
,
@Pattern
(
regexp
=
"\\d{6}"
,
message
=
"验证码格式有误"
)
@RequestParam
String
code
@
NotBlank
(
message
=
"验证码不能为空"
)
@
Pattern
(
regexp
=
"\\d{6}"
,
message
=
"验证码格式有误"
)
@RequestParam
String
code
)
{
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
(),
currentMobile
=
(
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
);
String
currentUid
=
CurrentUtil
.
getCurrentUid
(),
currentMobile
=
(
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
);
if
(!
LnsEnum
.
ENV
.
prod
.
name
().
equals
(
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)))
{
if
(!
LnsEnum
.
ENV
.
prod
.
name
().
equals
(
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)))
{
if
(!
CurrentUtil
.
GRAY_LOGIN_SMS_CODE
.
equals
(
code
))
{
if
(
CurrentUtil
.
GRAY_LOGIN_SMS_CODE
.
equals
(
code
))
return
ResponseDto
.
success
();
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140001"
));
}
}
String
cacheCode
=
goblinRedisUtils
.
getSmsCodeByMobile
(
currentMobile
);
}
else
{
if
(
StringUtils
.
isEmpty
(
cacheCode
))
{
String
cacheCode
=
goblinRedisUtils
.
getSmsCodeByMobile
(
currentMobile
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140018"
));
if
(
StringUtils
.
isEmpty
(
cacheCode
))
{
}
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140018"
));
if
(!
cacheCode
.
equals
(
code
))
{
}
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140001"
));
if
(!
cacheCode
.
equals
(
code
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140001"
));
}
}
}
GoblinUserSafeConfigDto
userSafeConfigDto
=
goblinRedisUtils
.
getUserSafeConfigDto
(
currentUid
);
GoblinUserSafeConfigDto
userSafeConfigDto
=
goblinRedisUtils
.
getUserSafeConfigDto
(
currentUid
);
if
(
null
!=
userSafeConfigDto
)
{
if
(
null
!=
userSafeConfigDto
)
{
...
...
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