Commit 88b12009 by fsn

登录出错也会记录到日志

parent 4bbbc3f0
...@@ -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";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment