@@ -35,6 +35,12 @@ public class UserLoginController { | |||
return loginService.login(loginDto); | |||
} | |||
@GetMapping("/logout") | |||
public Response logOut() { | |||
loginService.logout(); | |||
return response.success("登出成功!"); | |||
} | |||
/** | |||
* 图片验证码 | |||
* |
@@ -21,4 +21,9 @@ public interface IUserLoginService { | |||
*/ | |||
Response login(LoginDto loginDto); | |||
/** | |||
* 用户退出 | |||
*/ | |||
void logout(); | |||
} |
@@ -80,4 +80,12 @@ public class UserLoginServiceImpl extends ServiceImpl<UserAdminMapper, UserAdmin | |||
return response.success("登录成功", result); | |||
} | |||
/** | |||
* 登出 | |||
*/ | |||
@Override | |||
public void logout() { | |||
Subject subject = SecurityUtils.getSubject(); | |||
subject.logout(); | |||
} | |||
} |