Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
88b12009
Commit
88b12009
authored
Mar 30, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录出错也会记录到日志
parent
4bbbc3f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java
+4
-0
No files found.
src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java
View file @
88b12009
...
@@ -80,6 +80,8 @@ public class GlobalExceptionHandler {
...
@@ -80,6 +80,8 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
DisabledAccountException
.
class
)
@ExceptionHandler
(
DisabledAccountException
.
class
)
@ResponseStatus
(
HttpStatus
.
UNAUTHORIZED
)
@ResponseStatus
(
HttpStatus
.
UNAUTHORIZED
)
public
String
accountLocked
(
DisabledAccountException
e
,
Model
model
)
{
public
String
accountLocked
(
DisabledAccountException
e
,
Model
model
)
{
String
username
=
HttpKit
.
getRequest
().
getParameter
(
"username"
);
LogManager
.
loginLog
(
username
,
"账号被冻结"
);
model
.
addAttribute
(
"tips"
,
"账号被冻结"
);
model
.
addAttribute
(
"tips"
,
"账号被冻结"
);
return
"/login.html"
;
return
"/login.html"
;
}
}
...
@@ -92,6 +94,8 @@ public class GlobalExceptionHandler {
...
@@ -92,6 +94,8 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
CredentialsException
.
class
)
@ExceptionHandler
(
CredentialsException
.
class
)
@ResponseStatus
(
HttpStatus
.
UNAUTHORIZED
)
@ResponseStatus
(
HttpStatus
.
UNAUTHORIZED
)
public
String
credentials
(
CredentialsException
e
,
Model
model
)
{
public
String
credentials
(
CredentialsException
e
,
Model
model
)
{
String
username
=
HttpKit
.
getRequest
().
getParameter
(
"username"
);
LogManager
.
loginLog
(
username
,
"账号密码错误"
);
model
.
addAttribute
(
"tips"
,
"账号密码错误"
);
model
.
addAttribute
(
"tips"
,
"账号密码错误"
);
return
"/login.html"
;
return
"/login.html"
;
}
}
...
...
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