浏览代码

登陆和跳转登陆修改

sl 1 月之前
父节点
当前提交
f14cd2b8cc

+ 8 - 3
jeecg-module-interlock/src/main/java/org/jeecg/modules/ssoClient/controller/SSOLoginLogoutController.java

@@ -371,6 +371,11 @@ public class SSOLoginLogoutController {
             }else {
 //                response.setHeader("Set-Cookie", String.format("EIToken=%s; Max-Age=3600; Path=/", eiToken));
 //                response.setHeader("Set-Cookie", String.format("WISEUser=%s; Max-Age=3600; Path=/", usernameSSO));
+                if(usernameSSO==null || "".equals(usernameSSO)){
+                    loginResult.setResult(result.error("当前没有获取到用户名,请重新登录"));
+                    loginResult.setUpdate(false);
+                    return loginResult;
+                }
 
                 if(isHasSSORole.equals("0")){//如果没有SSORole字段,查询一下sso角色
                     //获取用户角色 是否是管理员
@@ -504,7 +509,7 @@ public class SSOLoginLogoutController {
         }
 
         //2. 校验联锁用户是否存在
-        SysUser sysUser1 = sysUserService.getUserAll(username);
+//        SysUser sysUser1 = sysUserService.getUserAll(username);
         InterlockUser interlockUser = interlockUserService.getInterlockUserByUserName(username);//根据用户名查询用户信息
         //如果联锁用户表中没有该sso用户,新增用户
         if(oConvertUtils.isEmpty(interlockUser)){
@@ -520,10 +525,10 @@ public class SSOLoginLogoutController {
             }
         }
 
-//        SysUser sysUser1 = sysUserService.getUserAll(username);//使用密码用来生成token
+        SysUser sysUser1 = sysUserService.getUserAll(username);//使用密码用来生成token
         InterlockUser interlockUser1 = interlockUserService.getInterlockUserByUserName(username);//根据用户名查询用户信息
         //用户登录信息
-        interlockUserInfo1(interlockUser1, password, result);
+        interlockUserInfo1(interlockUser1, sysUser1.getPassword(), result);
         LoginUser loginUser = new LoginUser();
         BeanUtils.copyProperties(sysUser1, loginUser);
         baseCommonService.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null,loginUser);