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
015803cb
Commit
015803cb
authored
Mar 26, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增补log:打印异常ip
parent
b3249311
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
ExceptionHandlingController.java
...antgroup/xyqb/controller/ExceptionHandlingController.java
+3
-2
IPUtil.java
src/main/java/cn/quantgroup/xyqb/util/IPUtil.java
+0
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/ExceptionHandlingController.java
View file @
015803cb
...
@@ -4,6 +4,7 @@ import cn.quantgroup.xyqb.exception.PasswordErrorLimitException;
...
@@ -4,6 +4,7 @@ import cn.quantgroup.xyqb.exception.PasswordErrorLimitException;
import
cn.quantgroup.xyqb.exception.UserNotExistException
;
import
cn.quantgroup.xyqb.exception.UserNotExistException
;
import
cn.quantgroup.xyqb.exception.VerificationCodeErrorException
;
import
cn.quantgroup.xyqb.exception.VerificationCodeErrorException
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.util.IPUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
...
@@ -34,7 +35,7 @@ public class ExceptionHandlingController implements IBaseController {
...
@@ -34,7 +35,7 @@ public class ExceptionHandlingController implements IBaseController {
*/
*/
@ExceptionHandler
(
PasswordErrorLimitException
.
class
)
@ExceptionHandler
(
PasswordErrorLimitException
.
class
)
public
JsonResult
passwordErrorLimitException
(
PasswordErrorLimitException
vce
)
{
public
JsonResult
passwordErrorLimitException
(
PasswordErrorLimitException
vce
)
{
LOGGER
.
info
(
"throw PasswordErrorLimitException,msg={},businessCode={}
"
,
vce
.
getMessage
(),
2L
);
LOGGER
.
info
(
"throw PasswordErrorLimitException,msg={},businessCode={}
, clientIp={}"
,
vce
.
getMessage
(),
2L
,
IPUtil
.
getRemoteIP
(
getRequest
())
);
return
JsonResult
.
buildErrorStateResult
(
vce
.
getMessage
(),
null
,
2L
);
return
JsonResult
.
buildErrorStateResult
(
vce
.
getMessage
(),
null
,
2L
);
}
}
...
@@ -46,7 +47,7 @@ public class ExceptionHandlingController implements IBaseController {
...
@@ -46,7 +47,7 @@ public class ExceptionHandlingController implements IBaseController {
*/
*/
@ExceptionHandler
(
VerificationCodeErrorException
.
class
)
@ExceptionHandler
(
VerificationCodeErrorException
.
class
)
public
JsonResult
verificationCodeErrorException
(
VerificationCodeErrorException
vce
)
{
public
JsonResult
verificationCodeErrorException
(
VerificationCodeErrorException
vce
)
{
LOGGER
.
info
(
"throw VerificationCodeErrorException,msg={},businessCode={}
"
,
vce
.
getMessage
(),
1L
);
LOGGER
.
info
(
"throw VerificationCodeErrorException,msg={},businessCode={}
, clientIp={}"
,
vce
.
getMessage
(),
1L
,
IPUtil
.
getRemoteIP
(
getRequest
())
);
return
JsonResult
.
buildErrorStateResult
(
vce
.
getMessage
(),
null
,
1L
);
return
JsonResult
.
buildErrorStateResult
(
vce
.
getMessage
(),
null
,
1L
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/util/IPUtil.java
View file @
015803cb
package
cn
.
quantgroup
.
xyqb
.
util
;
package
cn
.
quantgroup
.
xyqb
.
util
;
import
cn.quantgroup.tech.security.TechSecurityUtil
;
import
cn.quantgroup.tech.util.TechEnvironment
;
import
cn.quantgroup.tech.util.TechEnvironment
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
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