| | |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.ResultUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.security.core.AuthenticationException; |
| | | import org.springframework.security.web.AuthenticationEntryPoint; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-30 18:57 |
| | | **/ |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class AjaxAuthenticationEntryPoint implements AuthenticationEntryPoint { |
| | | |
| | | @Override |
| | | public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException { |
| | | ResultUtil.responseJson(httpServletResponse,R.fail("密码错误")); |
| | | log.error("错误信息【{}】",e.getMessage()); |
| | | ResultUtil.responseJson(httpServletResponse,R.fail(e.getMessage())); |
| | | } |
| | | } |