|
|
|
@ -36,6 +36,7 @@ public class LoginController { |
|
|
|
if (user == null) { |
|
|
|
if (user == null) { |
|
|
|
return ErrorEnum.LOGIN_ACCOUNT_ERROR.getCode(); |
|
|
|
return ErrorEnum.LOGIN_ACCOUNT_ERROR.getCode(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
request.getSession().setAttribute("user", user); |
|
|
|
return ErrorEnum.SUCCESS.getCode(); |
|
|
|
return ErrorEnum.SUCCESS.getCode(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -56,4 +57,10 @@ public class LoginController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/logout") |
|
|
|
|
|
|
|
public int logout(HttpServletRequest request) { |
|
|
|
|
|
|
|
request.getSession().removeAttribute("user"); |
|
|
|
|
|
|
|
return ErrorEnum.SUCCESS.getCode(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|