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
08d2c004
Commit
08d2c004
authored
Feb 08, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加极验开关
parent
3d92b780
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
NewCaptchaController.java
...yqb/controller/external/captcha/NewCaptchaController.java
+8
-2
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/captcha/NewCaptchaController.java
View file @
08d2c004
...
@@ -11,6 +11,7 @@ import cn.quantgroup.xyqb.util.IPUtil;
...
@@ -11,6 +11,7 @@ import cn.quantgroup.xyqb.util.IPUtil;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -32,6 +33,8 @@ public class NewCaptchaController {
...
@@ -32,6 +33,8 @@ public class NewCaptchaController {
private
IGeetestCaptchaService
geetestCaptchaService
;
private
IGeetestCaptchaService
geetestCaptchaService
;
@Resource
@Resource
private
IQuantgroupCaptchaService
quantgroupCaptchaService
;
private
IQuantgroupCaptchaService
quantgroupCaptchaService
;
@Value
(
"${geetest.close:false}"
)
private
String
geetestClose
;
@LogHttpCaller
@LogHttpCaller
@RequestMapping
(
value
=
"/captcha/new"
)
@RequestMapping
(
value
=
"/captcha/new"
)
...
@@ -43,9 +46,12 @@ public class NewCaptchaController {
...
@@ -43,9 +46,12 @@ public class NewCaptchaController {
}
}
// 数据容器
// 数据容器
Map
<
String
,
String
>
data
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
data
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
imgMap
=
null
;
// 优先获取极验
// 优先获取极验
Map
<
String
,
String
>
imgMap
=
geetestCaptchaService
.
fetchGeetestCaptcha
(
PasswordUtil
.
MD5
(
phoneNo
),
remoteIp
,
ClientType
.
valueByName
(
clientType
));
if
(!
Boolean
.
valueOf
(
geetestClose
)){
imgMap
=
geetestCaptchaService
.
fetchGeetestCaptcha
(
PasswordUtil
.
MD5
(
phoneNo
),
remoteIp
,
ClientType
.
valueByName
(
clientType
));
data
.
put
(
Constants
.
VERIFY_PARAM
,
Constants
.
VERIFY_TYPE_GT
);
data
.
put
(
Constants
.
VERIFY_PARAM
,
Constants
.
VERIFY_TYPE_GT
);
}
// 备选方案:量化派图形验证码
// 备选方案:量化派图形验证码
if
(
Objects
.
isNull
(
imgMap
)
||
imgMap
.
isEmpty
()){
if
(
Objects
.
isNull
(
imgMap
)
||
imgMap
.
isEmpty
()){
imgMap
=
quantgroupCaptchaService
.
fetchQuantgroupCaptcha
(
request
.
getLocale
());
imgMap
=
quantgroupCaptchaService
.
fetchQuantgroupCaptcha
(
request
.
getLocale
());
...
...
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