登录成功路径设置为重定向,防止重复加载登录

This commit is contained in:
zxm 2018-04-27 20:32:41 +08:00
parent a156d22f4d
commit ef3bd0fbc7
1 changed files with 5 additions and 1 deletions

View File

@ -106,7 +106,7 @@ public class LoginController {
subject.login(token);
//subject.hasRole("admin");
if (subject.isAuthenticated()) {
return "/main/main";
return "redirect:/main";
}
} catch (UnknownAccountException e) {
msg = "用户名/密码错误";
@ -121,6 +121,10 @@ public class LoginController {
return "/login";
}
@GetMapping("/main")
public String main(){
return "main/main";
}
@Log(desc = "用户退出平台")
@GetMapping(value = "/logout")
public String logout() {