| | |
| | | package com.panzhihua.auth.handel; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.ResultUtil; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.ResultUtil; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | **/ |
| | | public class UserLogoutSuccessHandler implements LogoutSuccessHandler { |
| | | /** |
| | | * 用户登出返回结果 |
| | | * 这里应该让前端清除掉Token |
| | | * 用户登出返回结果 这里应该让前端清除掉Token |
| | | * |
| | | * @Author youcong |
| | | */ |
| | | @Override |
| | | public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication){ |
| | | public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, |
| | | Authentication authentication) { |
| | | SecurityContextHolder.clearContext(); |
| | | ResultUtil.responseJson(response, R.ok()); |
| | | } |