mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 12:09:13 +08:00
build: 退出登录的接口检查是否有用户
This commit is contained in:
parent
4a531c2334
commit
ebd651ea94
@ -85,7 +85,10 @@ public class LoginController {
|
||||
|
||||
@GetMapping(value = "/signout")
|
||||
@Operation(summary = "退出登录")
|
||||
public ResultHolder logout(HttpServletResponse response) throws Exception {
|
||||
public ResultHolder logout() throws Exception {
|
||||
if (SessionUtils.getUser() == null) {
|
||||
return ResultHolder.success("logout success");
|
||||
}
|
||||
baseUserService.saveLog(SessionUtils.getUserId(), HttpMethodConstants.GET.name(), "/signout", "登出成功", OperationLogType.LOGOUT.name());
|
||||
SecurityUtils.getSubject().logout();
|
||||
return ResultHolder.success("logout success");
|
||||
|
Loading…
Reference in New Issue
Block a user