Selaa lähdekoodia

fix校验+登录

LLL 3 kuukautta sitten
vanhempi
commit
e2d5db8be1

+ 5 - 2
jeecg-module-interlock/src/main/java/org/jeecg/modules/ssoClient/controller/SSOLoginLogoutController.java

@@ -196,6 +196,8 @@ public class SSOLoginLogoutController {
                 loginResult.setUpdate(false);
                 return loginResult;
             }else {
+                response.setHeader("Set-Cookie", String.format("EIToken=%s; Max-Age=3600; Path=/", eiToken));
+
                 // 如果没有联锁token,或者有但与sso现在登录的账号名字不一样,都需要登录并返回登录信息
                 if(lsToken==null || "".equals(lsToken) || !usernameSSO.equals(JwtUtil.getUsername(lsToken))){
                     //1. 校验用户是否有效
@@ -265,7 +267,8 @@ public class SSOLoginLogoutController {
             return result;
         }
 
-        response.setHeader("Set-Cookie", String.format("EIToken=%s; Max-Age=3600; Path=/; Secure; SameSite=None", eiToken));
+//        response.setHeader("Set-Cookie", String.format("EIToken=%s; Max-Age=3600; Path=/; Secure; SameSite=None", eiToken));
+        response.setHeader("Set-Cookie", String.format("EIToken=%s; Max-Age=3600; Path=/", eiToken));
 
         //1. 校验用户是否有效
         SysUser sysUser = sysUserService.getUserAll(username);
@@ -509,7 +512,7 @@ public class SSOLoginLogoutController {
         String msg = IoTedgessolgout(response);
         if(!SSOConstants.LOGOUT_SUCCESS.equals(msg)) return Result.error(msg);
 
-        response.setHeader("Set-Cookie", String.format("EIToken=%s; Max-Age=0; Path=/; Secure; SameSite=None", ""));
+        response.setHeader("Set-Cookie", String.format("EIToken=%s; Max-Age=0; Path=/", ""));
 
         //用户退出逻辑
         String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);

+ 4 - 4
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -8,10 +8,10 @@ server:
     include-message: ALWAYS
   servlet:
     context-path: /jeecg-boot
-    session:
-      cookie:
-        same-site: none
-        secure: true
+#    session:
+#      cookie:
+#        same-site: none
+#        secure: true
   compression:
     enabled: true
     min-response-size: 1024