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
2e676c4e
Commit
2e676c4e
authored
Feb 05, 2018
by
贷前—徐菲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改常量的命名
parent
353ffbf8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
Constants.java
src/main/java/cn/quantgroup/xyqb/Constants.java
+3
-3
CaptchaNewValidateAdvisor.java
...tgroup/xyqb/aspect/captcha/CaptchaNewValidateAdvisor.java
+1
-1
NewCaptchaController.java
...yqb/controller/external/captcha/NewCaptchaController.java
+2
-4
No files found.
src/main/java/cn/quantgroup/xyqb/Constants.java
View file @
2e676c4e
...
...
@@ -100,11 +100,11 @@ public interface Constants {
String
FN_GEETEST_VALIDATE
=
"geetest_validate"
;
String
FN_GEETEST_SECCODE
=
"geetest_seccode"
;
/** 验证类型请求参数名 */
String
TEST_PARAM
=
"test
Type"
;
String
VERIFY_PARAM
=
"verify
Type"
;
/** 验证类型 - 极验 */
String
TEST
_TYPE_GT
=
"gt"
;
String
VERIFY
_TYPE_GT
=
"gt"
;
/** 验证类型 - 量化派图形验证 */
String
TEST
_TYPE_QG
=
"qg"
;
String
VERIFY
_TYPE_QG
=
"qg"
;
// -- End -- 验证码常量组
}
src/main/java/cn/quantgroup/xyqb/aspect/captcha/CaptchaNewValidateAdvisor.java
View file @
2e676c4e
...
...
@@ -51,7 +51,7 @@ public class CaptchaNewValidateAdvisor {
private
Object
doCaptchaValidate
(
ProceedingJoinPoint
pjp
)
throws
Throwable
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
// 验证码类别:gt - 极验,qg - 量化派图形验证
if
(
Objects
.
equals
(
Constants
.
TEST_TYPE_GT
,
request
.
getParameter
(
Constants
.
TEST
_PARAM
)))
{
if
(
Objects
.
equals
(
Constants
.
VERIFY_TYPE_GT
,
request
.
getParameter
(
Constants
.
VERIFY
_PARAM
)))
{
if
(
gtValid
(
request
)){
return
pjp
.
proceed
();
}
else
{
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/captcha/NewCaptchaController.java
View file @
2e676c4e
...
...
@@ -11,13 +11,11 @@ import cn.quantgroup.xyqb.util.IPUtil;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.json.JSONObject
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
...
...
@@ -46,11 +44,11 @@ public class NewCaptchaController {
Map
<
String
,
String
>
data
=
new
HashMap
<
String
,
String
>();
// 优先获取极验
Map
<
String
,
String
>
imgMap
=
geetestCaptchaService
.
fetchGeetestCaptcha
(
PasswordUtil
.
MD5
(
phoneNo
),
IPUtil
.
getRemoteIP
(
request
),
ClientType
.
valueByName
(
clientType
));
data
.
put
(
Constants
.
TEST_PARAM
,
Constants
.
TEST
_TYPE_GT
);
data
.
put
(
Constants
.
VERIFY_PARAM
,
Constants
.
VERIFY
_TYPE_GT
);
// 备选方案:量化派图形验证码
if
(
Objects
.
isNull
(
imgMap
)
||
imgMap
.
isEmpty
()){
imgMap
=
quantgroupCaptchaService
.
fetchQuantgroupCaptcha
(
request
.
getLocale
());
data
.
put
(
Constants
.
TEST_PARAM
,
Constants
.
TEST
_TYPE_QG
);
data
.
put
(
Constants
.
VERIFY_PARAM
,
Constants
.
VERIFY
_TYPE_QG
);
}
// 返回结果
if
(
Objects
.
isNull
(
imgMap
)
||
imgMap
.
isEmpty
()){
...
...
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