Procházet zdrojové kódy

修改新增SSO用户

丁治程 před 2 měsíci
rodič
revize
d447309964

+ 5 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockUser/service/impl/InterlockUserServiceImpl.java

@@ -146,7 +146,11 @@ public class InterlockUserServiceImpl extends ServiceImpl<InterlockUserMapper, I
     private int addSSOIoTEdgeUser(InterlockUserAdd interlockUserAdd, InterlockUser interlockUser, String eiToken) {
         int count = 0;
         try {
-            restClientService.addSSOUser(interlockUserAdd.getUsername());
+            String password = "";
+            if ("1".equals(interlockUserAdd.getInterlockUserType()) && ObjectUtil.isNotNull(interlockUserAdd.getPassword())){
+                password = interlockUserAdd.getPassword();
+            }
+            restClientService.addSSOUser(interlockUserAdd.getUsername(),password);
         } catch (Exception e) {
             log.info("SSO新增用户报错:{}",e.getMessage());
         } finally {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 5 - 3
jeecg-module-interlock/src/main/java/org/jeecg/modules/iotedgeCollectData/controller/IotedgeCollectDataController.java


+ 4 - 2
jeecg-module-interlock/src/main/java/org/jeecg/modules/iotedgeCollectData/service/RestClientService.java

@@ -420,7 +420,7 @@ public class RestClientService {
     *   des: 新增 SSO 用户
     *   date: 2024/8/5
     */
-    public JSONObject addSSOUser(String userName){
+    public JSONObject addSSOUser(String userName,String password){
         ArrayList<String> scopList = new ArrayList<>();
         scopList.add("Admin");
 
@@ -443,7 +443,9 @@ public class RestClientService {
         jsonObject.put("clientSecret",clientSecret);
         jsonObject.put("action","append");
         jsonObject.put("scopes",scopList);
-        //jsonObject.put("password","Asdfg@123");
+        if (ObjectUtil.isNotNull(password) || !"".equals(password)) {
+            jsonObject.put("password",password);
+        }
         HttpHeaders headers = new HttpHeaders();
         MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
         headers.setContentType(type);