From e7ce8d314ebd415aa8bf8d93f73aaac035f9858d Mon Sep 17 00:00:00 2001 From: gao <gaoleox@163> Date: Tue, 30 Jun 2020 15:42:32 +0800 Subject: [PATCH] 快捷卖出接口 --- src/main/java/com/xcong/excoin/configurations/security/CustomAuthenticationEntryPoint.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/xcong/excoin/configurations/security/CustomAuthenticationEntryPoint.java b/src/main/java/com/xcong/excoin/configurations/security/CustomAuthenticationEntryPoint.java index a28ffb8..7f8444c 100644 --- a/src/main/java/com/xcong/excoin/configurations/security/CustomAuthenticationEntryPoint.java +++ b/src/main/java/com/xcong/excoin/configurations/security/CustomAuthenticationEntryPoint.java @@ -6,6 +6,7 @@ import org.springframework.security.web.AuthenticationEntryPoint; import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -18,9 +19,10 @@ @Override public void commence(HttpServletRequest httpServletRequest, HttpServletResponse response, AuthenticationException e) throws IOException, ServletException { - Result result = Result.loginFail("fail"); + Result result = Result.loginFail("Unauthorized"); response.setCharacterEncoding("UTF-8"); response.setContentType("application/json; charset=utf-8"); response.getWriter().write(new ObjectMapper().writeValueAsString(result)); + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); } } -- Gitblit v1.9.1