From 5fab97cf7e49636d446e063ee6e0eea80c124bd2 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期三, 15 三月 2023 19:05:56 +0800 Subject: [PATCH] 支持不同域的前后端分离部署 --- src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java b/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java index 7a178d9..3f70b79 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java @@ -28,15 +28,6 @@ String username = jwtUser.getUserName(); UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, jwtUser.getPassword() ); SecurityContextHolder.getContext().setAuthentication(token); - System.out.println(jwt); - // 鍏佽璺ㄥ煙 - String origin = request.getHeader("Origin"); - response.setHeader("Access-Control-Allow-Credentials", "true"); - response.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*"); - response.setHeader("Access-Control-Allow-Methods", "PUT,POST, GET,DELETE,OPTIONS"); - // 鍏佽鑷畾涔夎姹傚ごtoken(鍏佽head璺ㄥ煙) - response.setHeader("Access-Control-Allow-Headers", "token, Accept, Origin, X-Requested-With, Content-Type, Last-Modified"); - response.setHeader("Content-type", "application/json;charset=UTF-8"); JSONObject jsonObject = new JSONObject(); jsonObject.put("code", ErrorCode.ERROR401.getCode()); jsonObject.put("msg", ErrorCode.ERROR401.getMsg()); -- Gitblit v1.8.0