huanghongfa
2020-12-30 b65e9c28408f906ef607ae7f802c8129a15e7df6
auth登录jiaoyan
1个文件已修改
6 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/AjaxAuthenticationEntryPoint.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/AjaxAuthenticationEntryPoint.java
@@ -2,6 +2,7 @@
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;
@@ -17,12 +18,13 @@
 * @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()));
    }
}