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
10115e1c
Commit
10115e1c
authored
Aug 01, 2023
by
唐峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
极验异常时,处理空指针问题
parent
ff608dc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
GeetestLib.java
...n/java/cn/quantgroup/xyqb/service/captcha/GeetestLib.java
+7
-2
No files found.
src/main/java/cn/quantgroup/xyqb/service/captcha/GeetestLib.java
View file @
10115e1c
...
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONException;
...
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONException;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.HttpStatus
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -297,17 +298,21 @@ public class GeetestLib {
...
@@ -297,17 +298,21 @@ public class GeetestLib {
}
}
String
return_seccode
=
""
;
String
return_seccode
=
""
;
try
{
try
{
if
(
StringUtils
.
isNotEmpty
(
response
))
{
return
val
;
}
JSONObject
return_map
=
JSONObject
.
parseObject
(
response
);
JSONObject
return_map
=
JSONObject
.
parseObject
(
response
);
return_seccode
=
return_map
.
getString
(
"seccode"
);
return_seccode
=
return_map
.
getString
(
"seccode"
);
gtlog
(
"md5: "
+
Md5Util
.
build
(
return_seccode
));
gtlog
(
"md5: "
+
Md5Util
.
build
(
return_seccode
));
if
(
return_seccode
.
equals
(
Md5Util
.
build
(
seccode
)))
{
if
(
return_seccode
.
equals
(
Md5Util
.
build
(
seccode
)))
{
gtlog
(
"validateMethod: "
+
return_map
.
getString
(
"challenge_type"
));
gtlog
(
"validateMethod: "
+
return_map
.
getString
(
"challenge_type"
));
val
.
put
(
"validataMethod"
,
return_map
.
getString
(
"challenge_type"
));
val
.
put
(
"validataMethod"
,
return_map
.
getString
(
"challenge_type"
));
val
.
put
(
"bl"
,
1
);
val
.
put
(
"bl"
,
1
);
return
val
;
return
val
;
}
else
{
}
else
{
return
val
;
return
val
;
}
}
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
gtlog
(
"json load error"
);
gtlog
(
"json load error"
);
return
val
;
return
val
;
...
@@ -348,7 +353,7 @@ public class GeetestLib {
...
@@ -348,7 +353,7 @@ public class GeetestLib {
protected
boolean
checkResultByPrivate
(
String
challenge
,
String
validate
)
{
protected
boolean
checkResultByPrivate
(
String
challenge
,
String
validate
)
{
gtlog
(
"privateKey: "
+
privateKey
);
gtlog
(
"privateKey: "
+
privateKey
);
String
encodeStr
=
Md5Util
.
build
(
privateKey
+
"geetest"
+
challenge
);
String
encodeStr
=
Md5Util
.
build
(
privateKey
+
"geetest"
+
challenge
);
gtlog
(
"encodeStr: "
+
encodeStr
);
gtlog
(
"encodeStr: "
+
encodeStr
);
gtlog
(
"valdate: "
+
validate
);
gtlog
(
"valdate: "
+
validate
);
return
validate
.
equals
(
encodeStr
);
return
validate
.
equals
(
encodeStr
);
}
}
...
...
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