跨域问题修复
This commit is contained in:
parent
56bd15494e
commit
d11be8cc0e
@ -18,6 +18,8 @@ import java.io.IOException;
|
|||||||
public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
|
public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
|
||||||
@Override
|
@Override
|
||||||
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
|
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.setCharacterEncoding("UTF-8");
|
||||||
response.setContentType("application/json");
|
response.setContentType("application/json");
|
||||||
response.getWriter().println(JSONUtil.parse(CommonResult.unauthorized(authException.getMessage())));
|
response.getWriter().println(JSONUtil.parse(CommonResult.unauthorized(authException.getMessage())));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user