Pārlūkot izejas kodu

系统新增不添加角色

sl 1 mēnesi atpakaļ
vecāks
revīzija
c9f3ee66ea

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

@@ -398,7 +398,7 @@ public class SSOLoginLogoutController {
                         // TODO 已经单点登录成功了的用户如果在本系统不存在,新增用户?——初始密码设为123456??
                         if(result.getMessage().equals(SSOConstants.BCZ) ){
                             log.info("用户在jeecg系统用户表中不存在,新增该用户");
-                            JSONObject addJSONObject = toAddJSONObject(usernameSSO,  "123456");
+                            JSONObject addJSONObject = toAddJSONObject2(usernameSSO,  "123456");
                             addUser(addJSONObject);
                         }else if(result.getMessage().equals(SSOConstants.YZX) || result.getMessage().equals(SSOConstants.YDj)){
                             // TODO 已注销或冻结的用户怎么处理?——首先不应该允许在本系统注销或者冻结用户?——如果真的有恢复正常状态?
@@ -495,7 +495,7 @@ public class SSOLoginLogoutController {
             // TODO 已经单点登录成功了的用户如果在本系统不存在,新增用户?
             if(result.getMessage().equals(SSOConstants.BCZ) ){
                 log.info("用户在本系统不存在,新增该用户");
-                JSONObject addJSONObject = toAddJSONObject(username, password);
+                JSONObject addJSONObject = toAddJSONObject2(username, password);
                 addUser(addJSONObject);
             }else if(result.getMessage().equals(SSOConstants.YZX) || result.getMessage().equals(SSOConstants.YDj)){
                 // TODO 已注销或冻结的用户怎么处理?——首先不应该允许在本系统注销或者冻结用户?——如果真的有恢复正常状态?
@@ -623,6 +623,25 @@ public class SSOLoginLogoutController {
         return jsonObject;
     }
 
+    /**
+     *  添加用户参数,没有角色
+     */
+    private JSONObject toAddJSONObject2(String username, String password){
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("workNo", "");
+        jsonObject.put("password", password);
+        jsonObject.put("confirmpassword", password);
+        jsonObject.put("phone", "18888888888");
+        jsonObject.put("selecteddeparts", "");
+        jsonObject.put("selectedroles", "");
+        jsonObject.put("activitiSync", "1");
+        jsonObject.put("departIds", "");
+        jsonObject.put("userIdentity", "1");
+        jsonObject.put("username", username);
+        jsonObject.put("realname", username);
+        return jsonObject;
+    }
+
     private  void  addUser(JSONObject jsonObject){
         String selectedRoles = jsonObject.getString("selectedroles");
         String selectedDeparts = jsonObject.getString("selecteddeparts");