diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/LoginController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/LoginController.java index dd21e85ef9..c96f3931fd 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/LoginController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/LoginController.java @@ -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");