diff --git a/mall-security/src/main/java/com/macro/mall/security/component/RestAuthenticationEntryPoint.java b/mall-security/src/main/java/com/macro/mall/security/component/RestAuthenticationEntryPoint.java index 8c0fbd9..5bd8536 100644 --- a/mall-security/src/main/java/com/macro/mall/security/component/RestAuthenticationEntryPoint.java +++ b/mall-security/src/main/java/com/macro/mall/security/component/RestAuthenticationEntryPoint.java @@ -18,6 +18,8 @@ import java.io.IOException; public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint { @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setHeader("Cache-Control","no-cache"); response.setCharacterEncoding("UTF-8"); response.setContentType("application/json"); response.getWriter().println(JSONUtil.parse(CommonResult.unauthorized(authException.getMessage())));