| | |
| | | import com.panzhihua.common.utlis.ResultUtil; |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.web.authentication.AuthenticationSuccessHandler; |
| | | |
| | |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 15:23 |
| | | **/ |
| | | @Slf4j |
| | | public class UserLoginSuccessHandler implements AuthenticationSuccessHandler { |
| | | @Override |
| | | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authentication) throws IOException, ServletException { |
| | | |
| | | log.info("登录成功"); |
| | | } |
| | | |
| | | @Override |
| | | public void onAuthenticationSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException, ServletException { |
| | | log.info("登录成功"); |
| | | // 组装JWT |
| | | LoginUserInfoVO loginUserInfoVO = (LoginUserInfoVO) authentication.getPrincipal(); |
| | | String token = JWTTokenUtil.generateToken(loginUserInfoVO); |