| | |
| | | package com.ruoyi.framework.security.handle;
|
| | |
|
| | | import java.io.IOException;
|
| | | import javax.servlet.ServletException;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import jakarta.servlet.ServletException;
|
| | | import jakarta.servlet.http.HttpServletRequest;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.RequiredArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | | import org.springframework.security.core.Authentication;
|
| | | import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
|
| | | import com.alibaba.fastjson2.JSON;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.constant.HttpStatus;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.framework.manager.AsyncManager;
|
| | |
| | | * @author ruoyi
|
| | | */
|
| | | @Configuration
|
| | | @RequiredArgsConstructor
|
| | | public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
|
| | | {
|
| | | @Autowired
|
| | | private TokenService tokenService;
|
| | |
|
| | | /**
|
| | |
| | | // 记录用户退出日志
|
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
|
| | | }
|
| | | ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功")));
|
| | | ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.success("退出成功")));
|
| | | }
|
| | | }
|