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
850d9659
Commit
850d9659
authored
Sep 06, 2017
by
Java—红包—徐 然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
6d068069
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
Constants.java
src/main/java/cn/quantgroup/xyqb/Constants.java
+1
-0
CaptchaNewValidateAdvisor.java
...tgroup/xyqb/aspect/captcha/CaptchaNewValidateAdvisor.java
+1
-1
SmsController.java
...uantgroup/xyqb/controller/internal/sms/SmsController.java
+8
-1
No files found.
src/main/java/cn/quantgroup/xyqb/Constants.java
View file @
850d9659
...
...
@@ -36,6 +36,7 @@ public interface Constants {
String
REDIS_VOICE_DEVICE_COUNT
=
"Voice_Device_verification_code_count:"
;
String
REDIS_VERIFICATION_COUNT
=
"verification_code_count:"
;
final
Long
Image_Need_Count
=
3L
;
/**
* redis中token的key值前缀
*/
...
...
src/main/java/cn/quantgroup/xyqb/aspect/captcha/CaptchaNewValidateAdvisor.java
View file @
850d9659
...
...
@@ -87,7 +87,7 @@ public class CaptchaNewValidateAdvisor {
Long
countPhone
=
countPhone
(
phoneNo
);
Long
countDeviceId
=
countDeviceId
(
deviceId
);
if
(
countIP
>
3
||
countPhone
>
3
||
countDeviceId
>
3
)
{
if
(
countIP
>
Constants
.
Image_Need_Count
||
countPhone
>
Constants
.
Image_Need_Count
||
countDeviceId
>
Constants
.
Image_Need_Count
)
{
if
(
shouldSkipCaptchaValidate
(
registerFrom
,
captchaId
,
captchaValue
))
{
LOGGER
.
info
(
"使用超级图形验证码校验, registerFrom={}, clientIp={}"
,
registerFrom
,
request
.
getRemoteAddr
());
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/sms/SmsController.java
View file @
850d9659
...
...
@@ -325,6 +325,13 @@ public class SmsController implements IBaseController {
}
}
/**
* 判断下次是否提示图形验证码
* @param clientIp
* @param deviceId
* @param phoneNo
* @return
*/
private
boolean
needImageVlidate
(
String
clientIp
,
String
deviceId
,
String
phoneNo
)
{
boolean
need
=
false
;
String
countIP
=
redisTemplate
.
opsForValue
().
get
(
IMAGE_IP_COUNT
+
clientIp
);
...
...
@@ -333,7 +340,7 @@ public class SmsController implements IBaseController {
Long
ip
=
StringUtils
.
isBlank
(
countIP
)
?
1L
:
Long
.
valueOf
(
countIP
);
Long
devId
=
StringUtils
.
isBlank
(
countDeviceId
)
?
1L
:
Long
.
valueOf
(
countDeviceId
);
Long
phNo
=
StringUtils
.
isBlank
(
countPhoneNo
)
?
1L
:
Long
.
valueOf
(
countPhoneNo
);
if
(
ip
>=
3L
||
devId
>=
3L
||
phNo
>=
3L
)
{
if
(
ip
>=
Constants
.
Image_Need_Count
||
devId
>=
Constants
.
Image_Need_Count
||
phNo
>=
Constants
.
Image_Need_Count
)
{
need
=
true
;
}
return
need
;
...
...
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