Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev' into ZL

ZL 3 viikkoa sitten
vanhempi
commit
069e4a9268
30 muutettua tiedostoa jossa 1009 lisäystä ja 740 poistoa
  1. 1 0
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
  2. 10 6
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/filters/JwtFilter.java
  3. 7 0
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/AppmanageController.java
  4. 21 24
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java
  5. 1 1
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/AppmanageEntity/AppBaseInfo.java
  6. 7 3
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/AppmanageEntity/AppUserInfoQueryParams.java
  7. 0 3
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/AppBaseInfoMapper.java
  8. 54 5
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/AppCustomMapper.java
  9. 2 0
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/AppCustomMapper.xml
  10. 2 0
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/AppmanageService.java
  11. 139 99
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/AppmanageServiceImpl.java
  12. 1 1
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/util/AppManageUtil.java
  13. 9 3
      jeecg-boot/jeecg-server-cloud/jflow-cloud-start/src/main/java/org/jeecg/config/DevelopAPI.java
  14. 4 3
      jeecg-boot/jflow-core/src/main/java/bp/difference/client/SystemClient.java
  15. 32 14
      jeecg-boot/jflow-core/src/main/java/bp/wf/Dev2Interface.java
  16. 31 4
      jeecg-boot/jflow-core/src/main/java/bp/wf/httphandler/WF_MyView.java
  17. 153 153
      jeecg-boot/lttc-module-appmanage/src/main/java/cn/lttc/modules/controller/AppmanageController.java
  18. 1 1
      jeecgboot-vue3/jflow-vue-core/_app.config.js
  19. 1 1
      jeecgboot-vue3/src/api/sys/user.ts
  20. 4 4
      jeecgboot-vue3/src/store/modules/user.ts
  21. 1 1
      jeecgboot-vue3/src/utils/http/axios/index.ts
  22. 8 0
      jeecgboot-vue3/src/views/appmanage/AppBaseInfo.api.ts
  23. 0 4
      jeecgboot-vue3/src/views/appmanage/AppBaseInfo.data.ts
  24. 1 1
      jeecgboot-vue3/src/views/appmanage/AppInfoList.vue
  25. 48 6
      jeecgboot-vue3/src/views/appmanage/addForm/Step1.vue
  26. 1 0
      jeecgboot-vue3/src/views/appmanage/addForm/Step4.vue
  27. 26 12
      jeecgboot-vue3/src/views/appmanage/addForm/data.tsx
  28. 0 1
      jeecgboot-vue3/src/views/appmanage/addForm/index.vue
  29. 11 0
      jeecgboot-vue3/src/views/integrityAppRegister/Demo.vue
  30. 433 390
      jeecgboot-vue3/src/views/system/loginmini/MiniLogin.vue

+ 1 - 0
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java

@@ -92,6 +92,7 @@ public interface CommonConstant {
     public static String PREFIX_USER_SHIRO_CACHE  = "shiro:cache:org.jeecg.config.shiro.ShiroRealm.authorizationCache:";
     /** 登录用户Token令牌缓存KEY前缀 */
     String PREFIX_USER_TOKEN  = "prefix_user_token:";
+   	String PREFIX_JFLOWUSER_TOKEN  = "prefix_jflowuser_token:";
 //    /** Token缓存时间:3600秒即一小时 */
 //    int  TOKEN_EXPIRE_TIME  = 3600;
 

+ 10 - 6
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/filters/JwtFilter.java

@@ -9,10 +9,11 @@ import org.jeecg.common.system.util.JwtUtil;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.config.shiro.JwtToken;
 import org.jeecg.config.shiro.ignore.InMemoryIgnoreAuth;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.RequestMethod;
-
+import redis.clients.jedis.Jedis;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
@@ -62,18 +63,21 @@ public class JwtFilter extends BasicHttpAuthenticationFilter {
         }
     }
 
-    /**
-     *
-     */
     @Override
     protected boolean executeLogin(ServletRequest request, ServletResponse response) throws Exception {
         HttpServletRequest httpServletRequest = (HttpServletRequest) request;
         String token = httpServletRequest.getHeader(CommonConstant.X_ACCESS_TOKEN);
-        // update-begin--Author:lvdandan Date:20210105 for:JT-355 OA聊天添加token验证,获取token参数
         if (oConvertUtils.isEmpty(token)) {
             token = httpServletRequest.getParameter("token");
         }
-        // update-end--Author:lvdandan Date:20210105 for:JT-355 OA聊天添加token验证,获取token参数
+        if (token.equals("undefined")){
+            // 连接到本地Redis服务
+            Jedis jedis = new Jedis("10.200.1.115", 6379);
+          	jedis.auth("Lttc123!");
+            String Token = httpServletRequest.getParameter("Token");
+            token = jedis.get(CommonConstant.PREFIX_JFLOWUSER_TOKEN+Token);
+            token = token.replaceAll("^\"|\"$", "");
+        }
 
         JwtToken jwtToken = new JwtToken(token);
         // 提交给realm进行登入,如果错误他会抛出异常并被捕获

+ 7 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/AppmanageController.java

@@ -189,4 +189,11 @@ public class AppmanageController {
         System.out.println("应用注册审核通过后续处理:"+formData);
         appInfoService.afterAppCheckPass(appid, formData);
     }
+
+    // 应用注册流程被撤销 后续处理(微服务调用)
+//    @GetMapping("/afterAppCheckPass")
+//    public <T> void afterUnsendAppRegisterFlow(@RequestParam("workID") long workID){
+//        System.out.println("应用注册流程撤销后续处理:"+workID);
+//        appInfoService.afterUnsendAppRegisterFlow(workID);
+//    }
 }

+ 21 - 24
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -23,7 +23,6 @@ import org.jeecg.config.JeecgBaseConfig;
 import org.jeecg.modules.base.service.BaseCommonService;
 import org.jeecg.modules.system.entity.SysDepart;
 import org.jeecg.modules.system.entity.SysRoleIndex;
-import org.jeecg.modules.system.entity.SysTenant;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.model.SysLoginModel;
 import org.jeecg.modules.system.service.*;
@@ -31,14 +30,12 @@ import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
 import org.jeecg.modules.system.util.RandImageUtil;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * @Author scott
@@ -80,25 +77,25 @@ public class LoginController {
 			return result.error500("该用户登录失败次数过多,请于10分钟后再次登录!");
 		}
 
-		// step.1 验证码check
-        String captcha = sysLoginModel.getCaptcha();
-        if(captcha==null){
-            result.error500("验证码无效");
-            return result;
-        }
-        String lowerCaseCaptcha = captcha.toLowerCase();
-		// 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
-        String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret();
-		String realKey = Md5Util.md5Encode(origin, "utf-8");
-		Object checkCode = redisUtil.get(realKey);
-		//当进入登录页时,有一定几率出现验证码错误 #1714
-		if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
-            log.warn("验证码错误,key= {} , Ui checkCode= {}, Redis checkCode = {}", sysLoginModel.getCheckKey(), lowerCaseCaptcha, checkCode);
-			result.error500("验证码错误");
-			// 改成特殊的code 便于前端判断
-			result.setCode(HttpStatus.PRECONDITION_FAILED.value());
-			return result;
-		}
+//		// step.1 验证码check
+//        String captcha = sysLoginModel.getCaptcha();
+//        if(captcha==null){
+//            result.error500("验证码无效");
+//            return result;
+//        }
+//        String lowerCaseCaptcha = captcha.toLowerCase();
+//		// 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
+//        String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret();
+//		String realKey = Md5Util.md5Encode(origin, "utf-8");
+//		Object checkCode = redisUtil.get(realKey);
+//		//当进入登录页时,有一定几率出现验证码错误 #1714
+//		if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
+//            log.warn("验证码错误,key= {} , Ui checkCode= {}, Redis checkCode = {}", sysLoginModel.getCheckKey(), lowerCaseCaptcha, checkCode);
+//			result.error500("验证码错误");
+//			// 改成特殊的code 便于前端判断
+//			result.setCode(HttpStatus.PRECONDITION_FAILED.value());
+//			return result;
+//		}
 		
 		// step.2 校验用户是否存在且有效
 		LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
@@ -122,8 +119,8 @@ public class LoginController {
 		userInfo(sysUser, result, request);
 
 		// step.5  登录成功删除验证码
-		redisUtil.del(realKey);
-		redisUtil.del(CommonConstant.LOGIN_FAIL + username);
+//		redisUtil.del(realKey);
+//		redisUtil.del(CommonConstant.LOGIN_FAIL + username);
 
 		// step.6  记录用户登录日志
 		LoginUser loginUser = new LoginUser();

+ 1 - 1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/AppmanageEntity/AppBaseInfo.java

@@ -39,7 +39,7 @@ public class AppBaseInfo {
     private String createBy;
     private String createTime;
     private String addType;
-    private int info_status;
+    private int infoStatus;
     @TableLogic
     private int delFlag;
     // 用于当前用户是否可以编辑该条信息

+ 7 - 3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/AppmanageEntity/AppUserInfoQueryParams.java

@@ -5,7 +5,7 @@ import lombok.Data;
 import java.util.List;
 
 /**
- * 功能描述
+ * 功能描述 : 查询应用用户信息参数
  *
  * @author: scott
  * @date: 2024年08月14日 PM 5:22
@@ -14,13 +14,17 @@ import java.util.List;
 public class AppUserInfoQueryParams {
     // 需过滤的用户id集合
     private List<String> filteruserids;
+    // 应用id
     private String appid;
+    // 部门(虽然是List,但是一般只有单个部门id)
     private List<String> dept;
+    // 角色(暂放)
     private String role;
+    // 用户名
     private List<String> realname;
     private List<String> username;
+    // 页码
     private Integer pageNo;
-
-    // 直接通过用户id集合查询用户信息集合(给注册应用信息时,表单一与表单四数据联动用)
+    // 直接通过用户id集合查询用户信息集合(暂放)
     private List<String> userids;
 }

+ 0 - 3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/AppBaseInfoMapper.java

@@ -33,9 +33,6 @@ public interface AppBaseInfoMapper extends BaseMapper<AppBaseInfo> {
     @Select("SELECT username from sys_user where id = #{id}")
     String queryUsernameById(@Param("id") String id);
 
-    // 真删除基础信息(非逻辑删除)
-    @Delete("delete from app_base_info where id = #{id}")
-    void deleteAppInfoNotLogic(@Param("id") String id);
 
     @Update("<script>" +
             "UPDATE app_base_info " +

+ 54 - 5
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/AppCustomMapper.java

@@ -1,10 +1,9 @@
 package org.jeecg.modules.system.mapper;
 
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.*;
 import org.jeecg.modules.system.entity.AppmanageEntity.AppBaseInfo;
 import org.jeecg.modules.system.entity.AppmanageEntity.AppUserInfo;
+import org.jeecg.modules.system.entity.SysPermission;
 
 import java.util.List;
 
@@ -18,9 +17,9 @@ public interface AppCustomMapper {
             "WHERE role_id IN (",
             "    SELECT id",
             "    FROM sys_role",
-            "    WHERE role_name = #{roleName}  and app_id = 0)"
+            "    WHERE role_code = 'basisPlatform_appAdmin')"
     })
-    List<String> queryUseridByAppAdminRole(@Param("roleName") String roleName);
+    List<String> queryUseridByAppAdminRole();
 
     // 通过用户id查询用户账号
     @Select("SELECT username FROM sys_user WHERE id = #{userId}")
@@ -34,5 +33,55 @@ public interface AppCustomMapper {
 
     String queryDepartIdByUserId(@Param("userId") String userId);
 
+    // 查询菜单是否已存在
+    @Select("SELECT * FROM sys_permission WHERE url = #{menuInfo}")
+    SysPermission queryUrlByUrl(@Param("menuInfo") String menuInfo);
+
+    // 真删除基础信息(非逻辑删除)
+    @Delete("delete from app_base_info where id = #{appid}")
+    void deleteAppBaseInfoNotLogic(@Param("appid") String appid);
+
+    // 真删除文档信息(非逻辑删除)
+    @Delete("delete from app_doc_info where appid = #{appid}")
+    void deleteAppDocInfoNotLogic(@Param("appid") String appid);
+
+    // 真删除环境信息(非逻辑删除)
+    @Delete("delete from app_env_info where appid = #{appid}")
+    void deleteAppEnvInfoNotLogic(@Param("appid") String appid);
+
+    // 真删除应用用户信息(非逻辑删除)
+    @Delete("delete from app_env_info where appid = #{appid}")
+    void deleteAppUserInfoNotLogic(@Param("appid") String appid);
+
+    @Select({
+            "SELECT CASE",
+            "WHEN FK_Flow = '021' THEN (",
+            "SELECT id FROM app_base_info_flow WHERE OID = #{workID}",
+            ")",
+            "WHEN FK_Flow = '022' THEN (",
+            "SELECT id FROM app_detail_info_workflow WHERE OID = #{workID}",
+            ")",
+            "ELSE NULL",
+            "END AS result",
+            "FROM wf_generworkflow",
+            "WHERE workID = #{workID}"
+    })
+    String getAppidByWorkID(@Param("workID") long workID);
+
+    // 通过应用id获取该应用注册类型
+    @Select("SELECT add_type FROM app_base_info WHERE id = #{appid}")
+    String queryAppRegisterTypeByAppid(@Param("appid") String appid);
+
+    // 添加应用后同步数据给Jflow的角色表
+    @Insert("INSERT INTO port_stationtype(No, Name, Idx) VALUES(#{appid},#{name},0)")
+    void addRoleToPortstationtype(@Param("appid") String id, @Param("name") String Name);
+
+    // 删除应用后同步数据给Jflow的角色表
+    @Delete("delete from port_stationtype where No = #{id}")
+    void deleteRoleFromPortstationtype(@Param("id") String id);
+
+    // 修改应用后同步数据给Jflow的角色表
+    @Update("UPDATE port_stationtype SET Name = #{appName} WHERE No = #{id}")
+    void updateRoleToPortstationtype(@Param("id") String id, @Param("appName") String Name);
 
 }

+ 2 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/AppCustomMapper.xml

@@ -50,4 +50,6 @@
     <select id="queryDepartIdByUserId" resultType="java.lang.String">
         SELECT dep_id FROM sys_user_depart WHERE user_id = #{userId}
     </select>
+
+
 </mapper>

+ 2 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/AppmanageService.java

@@ -67,5 +67,7 @@ public interface AppmanageService  {
     boolean isAppAdminOrDevOrOpe(String appid);
 
     <T> void afterAppCheckPass(String appid, T formData);
+
+    void afterUnsendAppRegisterFlow(long workID);
 }
 

+ 139 - 99
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/AppmanageServiceImpl.java

@@ -91,8 +91,6 @@ public class AppmanageServiceImpl implements AppmanageService {
     @Autowired
     private AppManageUtil appManageUtil;
 
-
-
     private final ReentrantLock lock = new ReentrantLock();
     private final String UNCHECK_TAG_BASE_PATH = "AppInfouncheckTag:";
 
@@ -117,7 +115,7 @@ public class AppmanageServiceImpl implements AppmanageService {
         appBaseInfo.setDelFlag(1);
         baseInfoMapper.insert(appBaseInfo);
 
-        // 提交至工作流的表单信息(将用户id换成用户账号,字典值换成字典文本
+        // 提交至工作流的表单信息(将用户id换成用户账号)
         AppBaseInfo sendCheck_appBaseInfo = appBaseInfo;
         sendCheck_appBaseInfo.setAdmin(customMapper.queryUsernameByUserId(appBaseInfo.getAdmin()));
         if (appBaseInfo.getDevelopUser()!=null)
@@ -128,19 +126,17 @@ public class AppmanageServiceImpl implements AppmanageService {
             sendCheck_appBaseInfo.setRequirementUser(customMapper.queryUsernameByUserId(appBaseInfo.getRequirementUser()));
         if (appBaseInfo.getBusinessUser()!=null)
             sendCheck_appBaseInfo.setBusinessUser(customMapper.queryUsernameByUserId(appBaseInfo.getBusinessUser()));
-//        sendCheck_appBaseInfo.setType(sysDictService.queryDictTextByKey("app_type", appBaseInfo.getType()));
-//        sendCheck_appBaseInfo.setStatus(sysDictService.queryDictTextByKey("app_status", appBaseInfo.getStatus()));
         AppDocInfo appDocInfo = appInfo.getAppDocInfoDTO();
         boolean hasEnvInfo = false;
         if (appInfo.getAppEnvInfoDTO()!=null) hasEnvInfo = appInfo.getAppEnvInfoDTO().size()>0;
+        boolean tag; // 流程发送结果标志
+        String appid = appBaseInfo.getId();
         // 简易注册模式下添加基础信息即可
         if (appBaseInfo.getAddType().equals("easy")){
-            boolean tag = appManageUtil.sendCheckWordFlow(sendCheck_appBaseInfo, "021", loginUser.getUsername(), "admin");
+             tag = appManageUtil.sendCheckWordFlow(sendCheck_appBaseInfo, "021", loginUser.getUsername(), "admin");
             // 发起流程失败则删除数据库内数据
-            if (tag){
-                return "提交成功";
-            } else {
-                baseInfoMapper.deleteAppInfoNotLogic(appBaseInfo.getId());
+            if (!tag){
+                customMapper.deleteAppBaseInfoNotLogic(appid);
                 return "提交失败";
             }
         }else {
@@ -152,17 +148,25 @@ public class AppmanageServiceImpl implements AppmanageService {
                 AppManageUtil appManageUtil = new AppManageUtil();
                 appRegisterWorkFlowFormEntity = appManageUtil.TransitionEnvInfoToAppRegisterWorkFlowForm(appRegisterWorkFlowFormEntity, appInfo.getAppEnvInfoDTO());
             }
-            appManageUtil.sendCheckWordFlow(appRegisterWorkFlowFormEntity, "022",loginUser.getUsername(),"admin");
+            tag = appManageUtil.sendCheckWordFlow(appRegisterWorkFlowFormEntity, "022", loginUser.getUsername(), "admin");
+            // 发起流程失败则删除数据库内数据
+            if (!tag){
+                customMapper.deleteAppBaseInfoNotLogic(appid);
+                customMapper.deleteAppDocInfoNotLogic(appid);
+                customMapper.deleteAppEnvInfoNotLogic(appid);
+                customMapper.deleteAppUserInfoNotLogic(appid);
+                return "提交失败";
+            }
         }
-        String appid = appBaseInfo.getId();
-
         // 添加应用用户信息
-        appInfo.getUserInfo().forEach(userid -> {
-            AppUserInfo userInfo = new AppUserInfo();
-            userInfo.setAppid(appid);
-            userInfo.setUserid(userid);
-            userInfoMapper.insert(userInfo);
-        });
+        if (appInfo.getUserInfo()!=null){
+            appInfo.getUserInfo().forEach(userid -> {
+                AppUserInfo userInfo = new AppUserInfo();
+                userInfo.setAppid(appid);
+                userInfo.setUserid(userid);
+                userInfoMapper.insert(userInfo);
+            });
+        }
 
         // 添加应用环境信息
         if (hasEnvInfo){
@@ -172,9 +176,10 @@ public class AppmanageServiceImpl implements AppmanageService {
             }
         }
         // 添加应用文档信息
-        appDocInfo.setAppid(appid);
-        docInfoMapper.insert(appDocInfo);
-
+        if (appDocInfo!=null){
+            appDocInfo.setAppid(appid);
+            docInfoMapper.insert(appDocInfo);
+        }
         return "提交成功";
     }
 
@@ -183,6 +188,7 @@ public class AppmanageServiceImpl implements AppmanageService {
      * @param ids 应用id集合
      * @return
      */
+    @Transactional
     @Override
     public Boolean deleteAppInfo(String[] ids) {
         // 需先判断用户是否拥有所删除的应用信息的权限(平台管理员-应用管理员)
@@ -226,7 +232,9 @@ public class AppmanageServiceImpl implements AppmanageService {
                     System.out.println("删除应用下角色失败:"+e);
                 }
             }
+            customMapper.deleteRoleFromPortstationtype(id);
         }
+
         // 记录日志
         baseCommonService.addLog("删除应用信息:id"+Arrays.toString(ids), CommonConstant.LOG_TYPE_2, 3 );
         return true;
@@ -238,14 +246,19 @@ public class AppmanageServiceImpl implements AppmanageService {
      * @return
      */
     @Override
-    public Boolean editBaseInfo(AppBaseInfo baseInfo) throws Exception {
-
+    public Boolean editBaseInfo(AppBaseInfo baseInfo) {
         int i = baseInfoMapper.updateById(baseInfo);
+        customMapper.updateRoleToPortstationtype(baseInfo.getId(), baseInfo.getName());
         // 保存成功解除反审核状态
         if (i>0) uncheckLock("AppbaseInfo"+baseInfo.getId());
         return i>0;
     }
 
+    /**
+     * 修改应用环境信息
+     * @param editEnvInfoEntity
+     * @return
+     */
     @Transactional
     @Override
     public Boolean editEnvInfo(AppEditEnvInfoEntity editEnvInfoEntity) {
@@ -350,7 +363,7 @@ public class AppmanageServiceImpl implements AppmanageService {
      * @param key 模糊查询关键字
      * @param type 应用类型
      * @param status 应用状态
-     * @param userid 用户id
+     * @param userid 用户id (暂放)
      * @return 应用基础信息集合
      */
 
@@ -372,7 +385,6 @@ public class AppmanageServiceImpl implements AppmanageService {
             appBaseInfoS.add(baseInfo);
         });
         redisUtil.set("appManagerInfo", appManagerInfo, 60*60*24);
-        // 使用 Collections.sort() 方法进行排序
 
         return appBaseInfoS;
 //        if(userid!=null){
@@ -409,9 +421,10 @@ public class AppmanageServiceImpl implements AppmanageService {
      */
     @Override
     public List<AppEnvInfo> queryEnvInfoByAppId(String appid) {
+        // 该用户是否可以查看当前应用的应用信息
         List<AppEnvInfo> envInfos = envInfoMapper.
-                selectList(new QueryWrapper<AppEnvInfo>().eq("appid", appid));
-        return envInfos;
+                    selectList(new QueryWrapper<AppEnvInfo>().eq("appid", appid));
+            return envInfos;
     }
 
     @Override
@@ -429,7 +442,6 @@ public class AppmanageServiceImpl implements AppmanageService {
      * 应用用户查询功能
      * @return
      */
-
     @Override
     public AppEditUserInfoEntity queryAppUser(AppUserInfoQueryParams queryParams) {
         List<Map<String, Object>> appUserInfos = new ArrayList<>();
@@ -454,15 +466,15 @@ public class AppmanageServiceImpl implements AppmanageService {
 
                 // 判断当前用户是否可进行编辑操作
                 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-                String managerId = "";
-                Map<String, String> appManagerInfo = new HashMap<>();
-                appManagerInfo = (Map<String, String>) redisUtil.get("appManagerInfo");
+                String managerId;
+                Map<String, String> appManagerUserInfo; // 应用管理员信息
                 // 先从 redis 查询应用管理员信息,如果为空,则查询数据库
-                if (appManagerInfo == null) {
+                appManagerUserInfo = (Map<String, String>) redisUtil.get("appManagerInfo");
+                if (appManagerUserInfo == null) {
                     AppBaseInfo baseInfoPO = baseInfoMapper.selectById(queryParams.getAppid());
                     managerId = baseInfoPO.getAdmin();
                 }else {
-                    managerId = appManagerInfo.get(queryParams.getAppid());
+                    managerId = appManagerUserInfo.get(queryParams.getAppid());
                 }
                 editUserInfoEntity.setIsEdit(loginUser.getId().equals(managerId));
                 AppBaseInfo appBaseInfo = baseInfoMapper.selectById(queryParams.getAppid());
@@ -470,12 +482,12 @@ public class AppmanageServiceImpl implements AppmanageService {
                 appUserInfos.forEach(map -> {
                     String roleNameInfo = appManageUtil.baseInfoToUserInfoRoles(appBaseInfo, (String) map.get("id"));
                     List<String> roleIds = sysUserRoleService.listByAppId(queryParams.getAppid(), (String) map.get("id"));
-
+                    // 查询角色名信息
                     if (!roleIds.isEmpty()){
-                        // 查询角色名信息
                         QueryWrapper<SysRole> sysRoleQueryWrapper = new QueryWrapper<>();
                         sysRoleQueryWrapper.select("role_name").in("id", roleIds);
                         List<SysRole> sysRoles = sysRoleMapper.selectList(sysRoleQueryWrapper);
+                        // 角色信息拼接
                         if (!sysRoles.isEmpty()&&!roleNameInfo.isEmpty()){
                             roleNameInfo =roleNameInfo +", "+ sysRoles.stream()
                                     .map(SysRole::getRoleName)
@@ -489,7 +501,7 @@ public class AppmanageServiceImpl implements AppmanageService {
                     map.put("roles", roleNameInfo);
                 });
             }
-        }else { // 作为添加表单时的查询(查询全部用户), 角色分配用户时亦使用
+        }else { // 作为添加表单时的查询(查询全部用户)
             appUserInfos = sysUserService.userComplexCondition(queryParams.getUserids(),
                     queryParams.getUsername(),
                     queryParams.getRealname(),
@@ -497,7 +509,7 @@ public class AppmanageServiceImpl implements AppmanageService {
                     queryParams.getFilteruserids(),
                     queryParams.getPageNo());
         }
-        // 如果查询到的用户不为空,则取appUserInfos最后一个值为total值,并将appUserInfos最后一个值删除
+        // 如果查询到的用户不为空,则取appUserInfos最后一个值为total值(分页使用),并将appUserInfos最后一个值删除
         if (!appUserInfos.isEmpty()){
             editUserInfoEntity.setTotal((Integer) appUserInfos.get(appUserInfos.size()-1).get("total"));
             appUserInfos.remove(appUserInfos.size()-1);
@@ -597,7 +609,7 @@ public class AppmanageServiceImpl implements AppmanageService {
     public boolean isAppAdmin() {
         // 获取当前登录用户
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        List<String> userids = customMapper.queryUseridByAppAdminRole("应用管理员");
+        List<String> userids = customMapper.queryUseridByAppAdminRole();
         return userids.stream().anyMatch(userid -> userid.equals(loginUser.getId()));
     }
 
@@ -609,6 +621,8 @@ public class AppmanageServiceImpl implements AppmanageService {
     public boolean isAppAdminOrDevOrOpe(String appid) {
         // 获取当前登录用户
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        // 如果是平台管理员
+        if (loginUser.getUsername().equals("admin")) return true;
         AppBaseInfo baseInfo = baseInfoMapper.selectById(appid);
         if (baseInfo!=null){
             if (baseInfo.getAdmin().equals(loginUser.getId())) return true;
@@ -619,10 +633,12 @@ public class AppmanageServiceImpl implements AppmanageService {
         return false;
     }
 
-    // 判断当前用户是否有编辑当前信息的权限
+    // 判断当前用户是否为当前应用的应用管理员
     public boolean hasEditCurrentInfoPermission(String appid){
         // 获取当前登录用户
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        // 如果是平台管理员
+        if (loginUser.getUsername().equals("admin")) return true;
         // 查询基础信息的应用管理员id,比较是否和当前登录用户一致
         QueryWrapper<AppBaseInfo> baseInfoPOQueryWrapper = new QueryWrapper<>();
         baseInfoPOQueryWrapper.select("admin").eq("id", appid);
@@ -654,66 +670,90 @@ public class AppmanageServiceImpl implements AppmanageService {
     }
 
 
-    // 应用审核通过后一系列创建应用一级菜单、默认角色、授权操作(完整注册时)
+    // 应用审核通过后续处理
     public <T> void afterAppCheckPass(String appid, T formData) {
-        AppBaseInfo appBaseInfo = baseInfoMapper.queryAppBaseInfoById(appid);
-        appManageUtil.CompareOldAppBaseInfoAndNewAppBaseInfo(appBaseInfo, formData);
-        // 以通过审批的应用信息为准更新应用信息
-        int i = baseInfoMapper.updateBaseInfo(appBaseInfo);
-        // 查询该应用信息
-
-        String toUser = baseInfoMapper.queryUsernameById(appBaseInfo.getCreateBy());
-        //给申请注册应用信息的用户发送系统消息
-        TemplateMessageDTO message = new TemplateMessageDTO();
-        message.setAppId("0");
-        message.setToUser(toUser);
-        // 设置消息模板编码
-        message.setTemplateCode("app_examineAndapprove");
-        Map<String, String> templateParam = new HashMap<>();
-        templateParam.put("resultText","通过");
-        message.setTemplateParam(templateParam);
-        sysBaseApi.sendTemplateAnnouncement(message);
-
-
-        // 判断该信息是否为完整注册
-        if (appBaseInfo.getAddType().equals("full")){
-            // 添加默认角色信息
-            SysRole role = new SysRole();
-            role.setAppId(appid);  // 设置角色所属应用信息
-            role.setRoleCode("default");  // 设置角色编码
-            role.setAppName(appBaseInfo.getName()) ;  // 设置角色的应用名称
-            role.setRoleName(appBaseInfo.getName()+"_默认用户角色");  // 设置角色名
-            sysRoleService.save(role);  // 添加角色
-
-            // 获取角色编码
-            String roleid = role.getId();
-
-            // 查询应用用户id集合
-            QueryWrapper<AppUserInfo> appUserInfoQueryWrapper = new QueryWrapper<>();
-            appUserInfoQueryWrapper.select("userid").eq("appid", appid);
-            List<AppUserInfo> appUserInfos = userInfoMapper.selectList(appUserInfoQueryWrapper);
-            List<String> useridlist = appUserInfos.stream().map(AppUserInfo::getUserid).collect(Collectors.toList());
-
-            // 应用默认角色分配给应用用户
-            SysUserRoleVO sysUserRoleVO = new SysUserRoleVO();
-            sysUserRoleVO.setRoleId(roleid);
-            sysUserRoleVO.setUserIdList(useridlist);
-            sysUserController.addSysUserRole(sysUserRoleVO);
-
-            // 创建该应用的一级菜单
-            SysPermission sysPermission = new SysPermission();
-            sysPermission.setName(appBaseInfo.getName());
-            sysPermission.setAppId(appid);
-            sysPermission.setUrl(appBaseInfo.getMenuInfo());
-            // 设置组件(即 菜单路径去掉第一个 "/")
-            String component = sysPermission.getUrl().replaceFirst("^/", "");
-            sysPermission.setComponent(component);
-            sysPermission.setMenuType(0);
-            sysPermission.setRoute(true);
-            sysPermissionService.addPermission(sysPermission);
-
-            // 授予应用默认角色访问一级菜单权限
-            sysRolePermissionService.saveRolePermission(roleid, sysPermission.getId(),"");
+
+        try {
+            AppBaseInfo appBaseInfo = baseInfoMapper.queryAppBaseInfoById(appid);
+            appManageUtil.CompareOldAppBaseInfoAndNewAppBaseInfo(appBaseInfo, formData);
+            // 以通过审批的应用信息为准更新应用信息
+            int i = baseInfoMapper.updateBaseInfo(appBaseInfo);
+            String toUser = baseInfoMapper.queryUsernameById(appBaseInfo.getCreateBy());
+            //给申请注册应用信息的用户发送系统消息
+            TemplateMessageDTO message = new TemplateMessageDTO();
+            message.setAppId("0");
+            message.setToUser(toUser);
+            // 设置消息模板编码
+            message.setTemplateCode("app_examineAndapprove");
+            Map<String, String> templateParam = new HashMap<>();
+            templateParam.put("resultText","应用"+appBaseInfo.getName()+"注册审核通过");
+            message.setTemplateParam(templateParam);
+            sysBaseApi.sendTemplateAnnouncement(message);
+
+            // 该信息为完整注册时,通过审核后添加默认角色、菜单权限、菜单信息
+            if (appBaseInfo.getAddType().equals("full")){
+                // 将通过完整注册的应用信息同步给JFlow的角色分类表
+                customMapper.addRoleToPortstationtype(appid, appBaseInfo.getName());
+                // 添加默认角色信息
+                SysRole role = new SysRole();
+                role.setAppId(appid);  // 设置角色所属应用信息
+                role.setRoleCode("default");  // 设置角色编码
+                role.setAppName(appBaseInfo.getName()) ;  // 设置角色的应用名称
+                role.setRoleName(appBaseInfo.getName()+"_默认用户角色");  // 设置角色名
+                role.setDescription(appBaseInfo.getName()+"默认角色");  // 设置备注
+                sysRoleService.save(role);  // 添加角色
+
+                // 获取角色编码
+                String roleid = role.getId();
+
+                // 查询应用用户id集合
+                QueryWrapper<AppUserInfo> appUserInfoQueryWrapper = new QueryWrapper<>();
+                appUserInfoQueryWrapper.select("userid").eq("appid", appid);
+                List<AppUserInfo> appUserInfos = userInfoMapper.selectList(appUserInfoQueryWrapper);
+                List<String> useridlist = appUserInfos.stream().map(AppUserInfo::getUserid).collect(Collectors.toList());
+
+                // 应用默认角色分配给应用用户
+                SysUserRoleVO sysUserRoleVO = new SysUserRoleVO();
+                sysUserRoleVO.setRoleId(roleid);
+                sysUserRoleVO.setUserIdList(useridlist);
+                sysUserController.addSysUserRole(sysUserRoleVO);
+
+                // 创建该应用的一级菜单
+                SysPermission hassysPermission = customMapper.queryUrlByUrl(appBaseInfo.getMenuInfo());
+                if (hassysPermission == null){
+                    SysPermission sysPermission = new SysPermission();
+                    sysPermission.setName(appBaseInfo.getName());
+                    sysPermission.setAppId(appid);
+                    sysPermission.setUrl(appBaseInfo.getMenuInfo());
+                    // 设置组件(即 菜单路径去掉第一个 "/")
+                    String component = sysPermission.getUrl().replaceFirst("^/", "");
+                    sysPermission.setComponent(component);
+                    sysPermission.setMenuType(0);
+                    sysPermission.setRoute(true);
+                    sysPermissionService.addPermission(sysPermission);
+                    // 授予应用默认角色访问一级菜单权限
+                    sysRolePermissionService.saveRolePermission(roleid, sysPermission.getId(),"");
+                }else {
+                    // 授予应用默认角色访问一级菜单权限
+                    sysRolePermissionService.saveRolePermission(roleid, hassysPermission.getId(),"");
+                }
+            }
+        }catch (Exception e){
+            System.out.println("应用审核通过后续处理错误:"+e);
+        }
+    }
+
+    // 应用注册 撤销后续处理(删除插入的数据)
+    @Override
+    public void afterUnsendAppRegisterFlow(long workID) {
+        // 通过workID获取应用id
+        String appid = customMapper.getAppidByWorkID(workID);
+        String addType = customMapper.queryAppRegisterTypeByAppid(appid);
+        customMapper.deleteAppBaseInfoNotLogic(appid);
+        if (addType.equals("full")){
+            customMapper.deleteAppDocInfoNotLogic(appid);
+            customMapper.deleteAppEnvInfoNotLogic(appid);
+            customMapper.deleteAppUserInfoNotLogic(appid);
         }
     }
 }

+ 1 - 1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/util/AppManageUtil.java

@@ -196,6 +196,6 @@ public class AppManageUtil {
         }
         // 将删除标志位恢复为 0,信息状态位变更为 1:已审核状态
         appBaseInfo.setDelFlag(0);
-        appBaseInfo.setInfo_status(1);
+        appBaseInfo.setInfoStatus(1);
     }
 }

+ 9 - 3
jeecg-boot/jeecg-server-cloud/jflow-cloud-start/src/main/java/org/jeecg/config/DevelopAPI.java

@@ -16,6 +16,8 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.RedisUtil;
+import org.jeecg.common.util.SpringContextUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
@@ -76,10 +78,11 @@ public class DevelopAPI extends HttpHandlerBase {
     @ApiOperation("根据密钥和用户名登录,返回用户登陆信息其中有Token")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "privateKey", value = "密钥", paramType = "query", required = true),
+            @ApiImplicitParam(name = "jeecgToken", value = "jeecg平台token", paramType = "query", required = false),
             @ApiImplicitParam(name = "userNo", value = "用户编号", required = true),
             @ApiImplicitParam(name = "orgNo", value = "租户/组织编号(集团版和SaaS版需要填写)", required = false),
     })
-    public final Object Port_Login_Submit(String privateKey, String userNo, String orgNo) throws Exception {
+    public final Object Port_Login_Submit(String privateKey, String jeecgToken, String userNo, String orgNo) throws Exception {
         if (DataType.IsNullOrEmpty(privateKey) == true) {
             return Return_Info(500, "登陆失败", "参数privateKey不能为空");
         }
@@ -101,14 +104,17 @@ public class DevelopAPI extends HttpHandlerBase {
         if (localKey.equals(privateKey) == false)
             return Return_Info(500, "登陆失败", "私钥错误,请检查全局文件中配置 PrivateKey");
 
+        RedisUtil redisUtil = SpringContextUtils.getBean(RedisUtil.class);
         try {
             String Token = "";
             if (SystemConfig.getCCBPMRunModel() == CCBPMRunModel.SAAS) {
-                Dev2Interface.Port_Login(userNo, orgNo);
+                Dev2Interface.Port_Login(userNo, orgNo, null);
                 Token = Dev2Interface.Port_GenerToken(userNo);
+                redisUtil.set("prefix_jflowuser_token:"+Token, jeecgToken, 3600 * 24 * 7);
             } else {
                 Token = Dev2Interface.Port_GenerToken(userNo);
-                Dev2Interface.Port_Login(userNo, orgNo);
+                redisUtil.set("prefix_jflowuser_token:"+Token, jeecgToken, 3600 * 24 * 7);
+                Dev2Interface.Port_Login(userNo, orgNo, null);
             }
             Hashtable ht = new Hashtable();
             ht.put("No", WebUser.getNo());

+ 4 - 3
jeecg-boot/jflow-core/src/main/java/bp/difference/client/SystemClient.java

@@ -1,10 +1,7 @@
 package bp.difference.client;
 
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
 @FeignClient(value = "jeecg-system")
@@ -14,4 +11,8 @@ public interface SystemClient {
     @GetMapping("/sys/applicationInfo/afterAppCheckPass")
     <T> void afterAppCheckPass(@RequestParam("appid") String appid,
                            @RequestParam("formData") T formData);
+
+    // 注册应用流程撤销 后续处理的微服务调用
+    @GetMapping("/sys/applicationInfo/afterUnsendAppRegisterFlow")
+    void afterUnsendAppRegisterFlow(@RequestParam("workID") long workID);
 }

+ 32 - 14
jeecg-boot/jflow-core/src/main/java/bp/wf/Dev2Interface.java

@@ -1,6 +1,7 @@
 package bp.wf;
 
 import bp.da.*;
+import bp.difference.client.SystemClient;
 import bp.en.*;
 import bp.port.*;
 import bp.port.Dept;
@@ -11,6 +12,11 @@ import bp.wf.template.*;
 import bp.difference.*;
 import bp.wf.template.sflow.*;
 import bp.wf.port.*;
+import org.jeecg.common.config.mqtoken.UserTokenContext;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.util.JwtUtil;
+import org.jeecg.common.util.RedisUtil;
+import org.jeecg.common.util.SpringContextUtils;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 
@@ -3852,7 +3858,6 @@ public class Dev2Interface
 
 	/**
 	 按照token登录 2021.07.01 采用新方式.
-
 	 @param token
 	*/
 	public static String Port_LoginByToken(String token)
@@ -4052,8 +4057,6 @@ public class Dev2Interface
 			return;
 		}
 
-
-
 		if (emp.getOrgNo().equals(orgNo) == false)
 		{
 			//如果选择的组织不存在,就从他的隶属部门里去找一个部门。
@@ -4063,10 +4066,7 @@ public class Dev2Interface
 			{
 				throw new RuntimeException("err@用户[" + emp.getNo() + "]在OrgNo[" + orgNo + "]下没有部门.");
 			}
-
-
 		}
-
 		emp.setDeptNo(deptNo);
 		WebUser.SignInOfGener(emp, "CH", false, false, null, null);
 	}
@@ -4183,7 +4183,6 @@ public class Dev2Interface
 			tk.setSheBei(1);
 		}
 		tk.Insert();
-
 		WebUser.setToken(tk.getMyPK());
 		return tk.getMyPK();
 	}
@@ -4292,7 +4291,7 @@ public class Dev2Interface
 
 		if (activeMinutes == 0)
 		{
-			activeMinutes = 300; //默认为300分钟.
+			activeMinutes = 10080; //默认为七天
 		}
 
 		String key = "Token_" + logDev; //para的参数.
@@ -4313,18 +4312,15 @@ public class Dev2Interface
 		{
 			String guid = DBAccess.GenerGUID(0, null, null);
 			emp.SetPara(key, guid);
-
 			LocalDateTime dt = LocalDateTime.now();
 			dt = dt.plusMinutes(activeMinutes);
-
 			emp.SetPara(key + "_DT", dt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
 			emp.Update();
 			WebUser.setToken(guid);
 			return guid;
 		}
 
-			///#endregion 如果是第1次登录,就生成新的token.
-
+		//#endregion 如果是第1次登录,就生成新的token.
 		//判断是否超时.
 		Date dtTo = DataType.ParseSysDateTime2DateTime(guidOID_Dt);
 		if (dtTo.compareTo(Calendar.getInstance().getTime()) < 0)
@@ -5894,10 +5890,9 @@ c	*/
 			}
 			unSendToNode = DBAccess.RunSQLReturnValInt(currNode, 0);
 		}
-
+		MicroserviceCall(workID);
 		WorkUnSend unSend = new WorkUnSend(flowNo, workID, unSendToNode, fid);
 		unSend.UnSendToNode = unSendToNode;
-
 		return unSend.DoUnSend();
 	}
 
@@ -15037,4 +15032,27 @@ c	*/
 
 		return tk.getMyPK();
 	}
+
+	public static String getTemporaryToken() {
+		RedisUtil redisUtil = SpringContextUtils.getBean(RedisUtil.class);
+		//模拟登录生成临时Token
+		//参数说明:第一个参数是用户名、第二个参数是密码的加密串
+		String token = JwtUtil.sign("??", "??");
+		// 设置Token缓存有效时间为 5 分钟
+		redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
+		redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 5 * 60 * 1000);
+		return token;
+	}
+
+	private static void MicroserviceCall(long workID){
+		String fk_flow = DBAccess.RunSQLReturnString("SELECT FK_Flow FROM wf_generworkflow WHERE WorkID = "+workID);
+		UserTokenContext.setToken(getTemporaryToken());
+		SystemClient systemClient = BeanUtils.getBean(SystemClient.class);
+		System.out.println("拿到的流程编号:"+fk_flow);
+		if (fk_flow.equals("021")||fk_flow.equals("022")){
+			System.out.println("应用注册流程微服务调用");
+//			systemClient.afterUnsendAppRegisterFlow(workID);
+		}
+		UserTokenContext.remove();
+	}
 }

+ 31 - 4
jeecg-boot/jflow-core/src/main/java/bp/wf/httphandler/WF_MyView.java

@@ -1,6 +1,7 @@
 package bp.wf.httphandler;
 
 import bp.da.*;
+import bp.difference.client.SystemClient;
 import bp.sys.*;
 import bp.web.*;
 import bp.port.*;
@@ -9,6 +10,11 @@ import bp.wf.template.*;
 import bp.difference.*;
 import bp.*;
 import bp.wf.*;
+import org.jeecg.common.config.mqtoken.UserTokenContext;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.util.JwtUtil;
+import org.jeecg.common.util.RedisUtil;
+import org.jeecg.common.util.SpringContextUtils;
 
 import java.net.URLEncoder;
 import java.util.*;
@@ -596,6 +602,8 @@ public class WF_MyView extends bp.difference.handler.DirectoryPageBase
 				gwl.SetPara("ToEmps", "");
 				gwl.Update();
 			}
+			// 撤销后续处理
+
 			return "撤销成功";
 		}
 		//获取用户当前所在的节点
@@ -703,11 +711,7 @@ public class WF_MyView extends bp.difference.handler.DirectoryPageBase
 				return true;
 			}
 		}
-
-
 			///#endregion 基本权限控制.
-
-
 			///#region 按照部门控制.
 		//本部门可见.
 		if (viewEn.getPMyDept() == true)
@@ -1672,5 +1676,28 @@ public class WF_MyView extends bp.difference.handler.DirectoryPageBase
 			return "err@" + ex.getMessage();
 		}
 	}
+	public static String getTemporaryToken() {
+		RedisUtil redisUtil = SpringContextUtils.getBean(RedisUtil.class);
+		//模拟登录生成临时Token
+		//参数说明:第一个参数是用户名、第二个参数是密码的加密串
+		String token = JwtUtil.sign("??", "??");
+		// 设置Token缓存有效时间为 5 分钟
+		redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
+		redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 5 * 60 * 1000);
+		return token;
+	}
+
+//	private void MicroserviceCall(){
+//		UserTokenContext.setToken(getTemporaryToken());
+//		String tag = this.rptGe.getRow().GetValStrByKey("workFlowType");
+//		switch (tag){
+//			case "App_Register":  // 应用注册审批流程
+//				SystemClient systemClient = BeanUtils.getBean(SystemClient.class);
+//				String appid = this.rptGe.getRow().GetValStrByKey("id");
+//				systemClient.afterAppCheckPass(appid, this.rptGe.getRow());
+//				break;
+//		}
+//		UserTokenContext.remove();
+//	}
 
 }

+ 153 - 153
jeecg-boot/lttc-module-appmanage/src/main/java/cn/lttc/modules/controller/AppmanageController.java

@@ -1,153 +1,153 @@
-package cn.lttc.modules.controller;
-
-import cn.lttc.modules.dto.*;
-import cn.lttc.modules.dto.queryParamsDTO.AppUserInfoQueryParamsDTO;
-import cn.lttc.modules.entity.EditEnvInfoEntity;
-import cn.lttc.modules.entity.EditUserInfoEntity;
-import cn.lttc.modules.service.AppmanageService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.api.vo.Result;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 功能描述
- * @author: scott
- * @date: 2024年07月31日 AM 8:29
- */
-
-//@Slf4j
-//@Api(tags = "应用管理")
-//@RestController
-//@RequestMapping("/applicationInfo")
-public class AppmanageController {
-
-//    @Autowired
-//    private AppmanageService appInfoService;
-//
-//    @ApiOperation("注册应用信息")
-//    @PostMapping("/add")
-//    public Result<String> addAppInfo(@RequestBody AppInfoDTO appInfo) throws Exception {
-//        System.out.println(appInfo.toString());
-//        String message = appInfoService.addAppInfo(appInfo);
-//        return Result.OK(message);
-//    }
-//
-//    @ApiOperation("删除应用信息")
-//    @PostMapping("/delete")
-//    public Result<String> deleteAppInfo(@RequestBody String[] infos){
-//        System.out.println("来到删除信息:"+ Arrays.toString(infos));
-//        String message = appInfoService.deleteAppInfo(infos);
-//        return Result.ok(message);
-//    }
-//
-//    @ApiOperation("修改应用基础信息")
-//    @PostMapping("/editBaseInfo")
-//    public Result<Boolean> editBaseInfo(@RequestBody AppBaseInfoDTO baseInfoDTO) throws Exception {
-//        return Result.ok(appInfoService.editBaseInfo(baseInfoDTO));
-//    }
-//
-//    @ApiOperation("修改应用环境信息")
-//    @PostMapping("/editEnvInfo")
-//    public Result<Boolean> editEnvInfo(@RequestBody EditEnvInfoEntity editEnvInfoEntity){
-//        System.out.println("看看能不能拿到appid:"+editEnvInfoEntity.getAppid());
-//        return Result.ok(appInfoService.editEnvInfo(editEnvInfoEntity));
-//    }
-//
-//    @ApiOperation("修改应用文档信息")
-//    @PostMapping("/editDocInfo")
-//    public Result<Boolean> editDocInfo(@RequestBody AppDocInfoDTO docInfoDTO){
-//        return Result.ok(appInfoService.editDocInfo(docInfoDTO));
-//    }
-//
-//    @ApiOperation("修改应用用户信息")
-//    @PostMapping("/editUserInfo")
-//    public Result<Boolean> editUserInfo(@RequestBody UpdataUserInfoDTO updataUserInfoDTO){
-//        Boolean tag = appInfoService.editUserInfo(updataUserInfoDTO);
-//        return Result.ok(tag);
-//    }
-//
-//    @ApiOperation("查询应用信息列表")
-//    @GetMapping("/query")
-//    public Result<List<AppBaseInfoDTO>> queryAppInfoList(
-//            @RequestParam(name = "appname", required = false) String appname,
-//            @RequestParam(name = "apptype", required = false) String apptype,
-//            @RequestParam(name = "appstatus", required = false) String appstatus,
-//            @RequestParam(name = "user", required = false) String userid){
-//        List<AppBaseInfoDTO> appbaseInfos = appInfoService.queryBaseInfo(appname, apptype, appstatus, userid);
-//        return Result.ok(appbaseInfos);
-//    }
-//
-//    @ApiOperation("查询应用基础信息")
-//    @GetMapping("/queryBaseInfoById")
-//    public Result<AppBaseInfoDTO> queryBaseInfoById(String id){
-//        AppBaseInfoDTO appbaseInfo = appInfoService.queryBaseInfoById(id);
-//        return Result.ok(appbaseInfo);
-//    }
-//
-//    @ApiOperation("查询应用环境信息")
-//    @GetMapping("/queryEnvInfoById")
-//    public Result<List<AppEnvInfoDTO>> queryEnvInfoById(String appid){
-//        List<AppEnvInfoDTO> appenvInfos = appInfoService.queryEnvInfoByAppId(appid);
-//        return Result.ok(appenvInfos);
-//    }
-//
-//    // 查看应用文档信息
-//    @GetMapping("/queryDocInfoById")
-//    public Result<AppDocInfoDTO> queryDocInfoById(String id){
-//        AppDocInfoDTO appdocInfo = appInfoService.queryDocInfoById(id);
-//        return Result.ok(appdocInfo);
-//    }
-//
-//    /**
-//     * @return 用户集合
-//     */
-//    @ApiOperation("查询应用用户列表")
-//    @PostMapping("/user/query")
-//    public Result<EditUserInfoEntity> queryAppUser(@RequestBody AppUserInfoQueryParamsDTO queryParams) {
-//        System.out.println("查询应用用户列表:"+queryParams.getPageNo());
-//        if (queryParams.getPageNo() == null) queryParams.setPageNo(1);
-//        return Result.ok(appInfoService.queryAppUser(queryParams));
-//    }
-//
-//    @GetMapping("/queryAppInfoDetail")
-//    public Result<AppInfoDetailDTO> queryAppInfoDetail(String appid){
-//        AppInfoDetailDTO appDetailInfoDTO = appInfoService.queryAppInfodetail(appid);
-//        return Result.ok(appDetailInfoDTO);
-//    }
-//
-//    // 反审核
-//    @GetMapping("/getLock")
-//    public Result<Boolean> checkLock(String key){
-//        System.out.println("访问到了:"+key);
-//        return Result.ok(appInfoService.checkLock(key));
-//    }
-//
-//    @GetMapping("/getAppuserids")
-//    public Result<List<String>> getAppUserids(String appid){
-//        return Result.ok(appInfoService.getAppuserids(appid));
-//    }
-//
-//    @GetMapping("/test")
-//    public String test(){
-//        return "应用管理测试接口";
-//    }
-//
-//    // 解除反审核
-//    @GetMapping("/unLock")
-//    public Result<Boolean> uncheckLock(String key){
-//        return Result.ok(appInfoService.uncheckLock(key));
-//    }
-//
-//
-//    // 判断当前登录用户是否为信息部用户
-//    @GetMapping("/isInfoUser")
-//    public Result<Boolean> isInfoUser(){
-//        return Result.ok(appInfoService.isInfoUser());
-//    }
-}
+//package cn.lttc.modules.controller;
+//
+//import cn.lttc.modules.dto.*;
+//import cn.lttc.modules.dto.queryParamsDTO.AppUserInfoQueryParamsDTO;
+//import cn.lttc.modules.entity.EditEnvInfoEntity;
+//import cn.lttc.modules.entity.EditUserInfoEntity;
+//import cn.lttc.modules.service.AppmanageService;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import lombok.extern.slf4j.Slf4j;
+//import org.jeecg.common.api.vo.Result;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.*;
+//import java.util.Arrays;
+//import java.util.List;
+//import java.util.Map;
+//
+///**
+// * 功能描述
+// * @author: scott
+// * @date: 2024年07月31日 AM 8:29
+// */
+//
+////@Slf4j
+////@Api(tags = "应用管理")
+////@RestController
+////@RequestMapping("/applicationInfo")
+//public class AppmanageController {
+//
+////    @Autowired
+////    private AppmanageService appInfoService;
+////
+////    @ApiOperation("注册应用信息")
+////    @PostMapping("/add")
+////    public Result<String> addAppInfo(@RequestBody AppInfoDTO appInfo) throws Exception {
+////        System.out.println(appInfo.toString());
+////        String message = appInfoService.addAppInfo(appInfo);
+////        return Result.OK(message);
+////    }
+////
+////    @ApiOperation("删除应用信息")
+////    @PostMapping("/delete")
+////    public Result<String> deleteAppInfo(@RequestBody String[] infos){
+////        System.out.println("来到删除信息:"+ Arrays.toString(infos));
+////        String message = appInfoService.deleteAppInfo(infos);
+////        return Result.ok(message);
+////    }
+////
+////    @ApiOperation("修改应用基础信息")
+////    @PostMapping("/editBaseInfo")
+////    public Result<Boolean> editBaseInfo(@RequestBody AppBaseInfoDTO baseInfoDTO) throws Exception {
+////        return Result.ok(appInfoService.editBaseInfo(baseInfoDTO));
+////    }
+////
+////    @ApiOperation("修改应用环境信息")
+////    @PostMapping("/editEnvInfo")
+////    public Result<Boolean> editEnvInfo(@RequestBody EditEnvInfoEntity editEnvInfoEntity){
+////        System.out.println("看看能不能拿到appid:"+editEnvInfoEntity.getAppid());
+////        return Result.ok(appInfoService.editEnvInfo(editEnvInfoEntity));
+////    }
+////
+////    @ApiOperation("修改应用文档信息")
+////    @PostMapping("/editDocInfo")
+////    public Result<Boolean> editDocInfo(@RequestBody AppDocInfoDTO docInfoDTO){
+////        return Result.ok(appInfoService.editDocInfo(docInfoDTO));
+////    }
+////
+////    @ApiOperation("修改应用用户信息")
+////    @PostMapping("/editUserInfo")
+////    public Result<Boolean> editUserInfo(@RequestBody UpdataUserInfoDTO updataUserInfoDTO){
+////        Boolean tag = appInfoService.editUserInfo(updataUserInfoDTO);
+////        return Result.ok(tag);
+////    }
+////
+////    @ApiOperation("查询应用信息列表")
+////    @GetMapping("/query")
+////    public Result<List<AppBaseInfoDTO>> queryAppInfoList(
+////            @RequestParam(name = "appname", required = false) String appname,
+////            @RequestParam(name = "apptype", required = false) String apptype,
+////            @RequestParam(name = "appstatus", required = false) String appstatus,
+////            @RequestParam(name = "user", required = false) String userid){
+////        List<AppBaseInfoDTO> appbaseInfos = appInfoService.queryBaseInfo(appname, apptype, appstatus, userid);
+////        return Result.ok(appbaseInfos);
+////    }
+////
+////    @ApiOperation("查询应用基础信息")
+////    @GetMapping("/queryBaseInfoById")
+////    public Result<AppBaseInfoDTO> queryBaseInfoById(String id){
+////        AppBaseInfoDTO appbaseInfo = appInfoService.queryBaseInfoById(id);
+////        return Result.ok(appbaseInfo);
+////    }
+////
+////    @ApiOperation("查询应用环境信息")
+////    @GetMapping("/queryEnvInfoById")
+////    public Result<List<AppEnvInfoDTO>> queryEnvInfoById(String appid){
+////        List<AppEnvInfoDTO> appenvInfos = appInfoService.queryEnvInfoByAppId(appid);
+////        return Result.ok(appenvInfos);
+////    }
+////
+////    // 查看应用文档信息
+////    @GetMapping("/queryDocInfoById")
+////    public Result<AppDocInfoDTO> queryDocInfoById(String id){
+////        AppDocInfoDTO appdocInfo = appInfoService.queryDocInfoById(id);
+////        return Result.ok(appdocInfo);
+////    }
+////
+////    /**
+////     * @return 用户集合
+////     */
+////    @ApiOperation("查询应用用户列表")
+////    @PostMapping("/user/query")
+////    public Result<EditUserInfoEntity> queryAppUser(@RequestBody AppUserInfoQueryParamsDTO queryParams) {
+////        System.out.println("查询应用用户列表:"+queryParams.getPageNo());
+////        if (queryParams.getPageNo() == null) queryParams.setPageNo(1);
+////        return Result.ok(appInfoService.queryAppUser(queryParams));
+////    }
+////
+////    @GetMapping("/queryAppInfoDetail")
+////    public Result<AppInfoDetailDTO> queryAppInfoDetail(String appid){
+////        AppInfoDetailDTO appDetailInfoDTO = appInfoService.queryAppInfodetail(appid);
+////        return Result.ok(appDetailInfoDTO);
+////    }
+////
+////    // 反审核
+////    @GetMapping("/getLock")
+////    public Result<Boolean> checkLock(String key){
+////        System.out.println("访问到了:"+key);
+////        return Result.ok(appInfoService.checkLock(key));
+////    }
+////
+////    @GetMapping("/getAppuserids")
+////    public Result<List<String>> getAppUserids(String appid){
+////        return Result.ok(appInfoService.getAppuserids(appid));
+////    }
+////
+////    @GetMapping("/test")
+////    public String test(){
+////        return "应用管理测试接口";
+////    }
+////
+////    // 解除反审核
+////    @GetMapping("/unLock")
+////    public Result<Boolean> uncheckLock(String key){
+////        return Result.ok(appInfoService.uncheckLock(key));
+////    }
+////
+////
+////    // 判断当前登录用户是否为信息部用户
+////    @GetMapping("/isInfoUser")
+////    public Result<Boolean> isInfoUser(){
+////        return Result.ok(appInfoService.isInfoUser());
+////    }
+//}

+ 1 - 1
jeecgboot-vue3/jflow-vue-core/_app.config.js

@@ -1 +1 @@
-window.__PRODUCTION__CCFLOW__CONF__={"VITE_GLOB_APP_TITLE":"驰骋软件","VITE_GLOB_APP_SHORT_NAME":"ccflow","VITE_GLOB_PLATFORM":"JFlow","VITE_GLOB_SSO":"false","VITE_GLOB_API_URL":"http://jeecg-boot-gateway:9999","VITE_GLOB_CCFLOW_HANDLER":"WF/Comm/Handler.ashx","VITE_GLOB_JFLOW_HANDLER":"WF/Comm/ProcessRequest","VITE_GLOB_CCFLOW_UPLOAD_URL":"/api/WF/Comm/ProcessRequest","VITE_GLOB_JFLOW_UPLOAD_URL":"/WF/Ath/AttachmentUploadS","VITE_GLOB_IS_THIRDPART_SYSTEM":"1","VITE_GLOB_THIRDPART_TOKEN_KEY":"Admin-Token","VITE_GLOB_UPLOAD_URL":"/upload","VITE_GLOB_API_URL_PREFIX":""};Object.freeze(window.__PRODUCTION__CCFLOW__CONF__);Object.defineProperty(window,"__PRODUCTION__CCFLOW__CONF__",{configurable:false,writable:false,});
+window.__PRODUCTION__CCFLOW__CONF__={"VITE_GLOB_APP_TITLE":"驰骋软件","VITE_GLOB_APP_SHORT_NAME":"ccflow","VITE_GLOB_PLATFORM":"JFlow","VITE_GLOB_SSO":"false","VITE_GLOB_API_URL":"http://10.200.1.115:9999","VITE_GLOB_CCFLOW_HANDLER":"WF/Comm/Handler.ashx","VITE_GLOB_JFLOW_HANDLER":"WF/Comm/ProcessRequest","VITE_GLOB_CCFLOW_UPLOAD_URL":"/api/WF/Comm/ProcessRequest","VITE_GLOB_JFLOW_UPLOAD_URL":"/WF/Ath/AttachmentUploadS","VITE_GLOB_IS_THIRDPART_SYSTEM":"1","VITE_GLOB_THIRDPART_TOKEN_KEY":"Admin-Token","VITE_GLOB_UPLOAD_URL":"/upload","VITE_GLOB_API_URL_PREFIX":""};Object.freeze(window.__PRODUCTION__CCFLOW__CONF__);Object.defineProperty(window,"__PRODUCTION__CCFLOW__CONF__",{configurable:false,writable:false,});

+ 1 - 1
jeecgboot-vue3/src/api/sys/user.ts

@@ -70,7 +70,7 @@ export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal')
 export function jflowLoginApi(params, mode: ErrorMessageMode = 'modal') {
   return defHttp.post<jflowLoginResultModel | string>(
     {
-      url: Api.jflowLogin + '?userNo=' + params.userNo + '&privateKey=' + params.privateKey,
+      url: Api.jflowLogin + '?userNo=' + params.userNo + '&privateKey=' + params.privateKey +'&jeecgToken=' + params.jeecgToken,
     },
     {
       errorMessageMode: mode,

+ 4 - 4
jeecgboot-vue3/src/store/modules/user.ts

@@ -120,10 +120,10 @@ export const useUserStore = defineStore({
     },
     setJFlowToken(info: string | undefined) {
       this.jflowToken = info ? info : ''; // for null or undefined value
-      // Cookies.set(JFLOW_TOKEN_KEY, info);
       setAuthCache(JFLOW_TOKEN_KEY, info);
+      Cookies.set(JFLOW_TOKEN_KEY, info);
       if (!Cookies.get(CURR_SYS_TOKEN_ALIAS)) {
-        Cookies.set(CURR_SYS_TOKEN_ALIAS, this.getToken);
+        Cookies.set(CURR_SYS_TOKEN_ALIAS, info);
       }
     },
     setRoleList(roleList: RoleEnum[]) {
@@ -173,9 +173,9 @@ export const useUserStore = defineStore({
 
     // 登录到jflow
     async loginToJFlow(username: string, mode: ErrorMessageMode) {
-      console.log("执行了登录JFlow方法")
+      console.log("执行了登录JFlow方法"+this.getToken)
       //jflowtoken
-      const jflowLoginInfo = await jflowLoginApi({ userNo: username, privateKey: import.meta.env.VITE_APP_JFLOW_KEY }, mode);
+      const jflowLoginInfo = await jflowLoginApi({ userNo: username, privateKey: import.meta.env.VITE_APP_JFLOW_KEY, jeecgToken: this.getToken }, mode);
       console.dir(jflowLoginInfo)
       try {
         const jflowInfo = JSON.parse(jflowLoginInfo as string);

+ 1 - 1
jeecgboot-vue3/src/utils/http/axios/index.ts

@@ -261,7 +261,7 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
         // authenticationScheme: 'Bearer',
         authenticationScheme: '',
         //接口超时设置
-        timeout: 10 * 1000,
+        timeout: 50 * 1000,
         // 基础接口地址
         // baseURL: globSetting.apiUrl,
         headers: { 'Content-Type': ContentTypeEnum.JSON },

+ 8 - 0
jeecgboot-vue3/src/views/appmanage/AppBaseInfo.api.ts

@@ -26,6 +26,7 @@ enum Api {
     unLock = '/sys/applicationInfo/unLock',
     editUserInfo = '/sys/applicationInfo/editUserInfo',
     selectUserByDept = '/sys/sysDepart/getUsersByDepartId',
+    getUserListByRoleId = '/sys/user/getUserListByRoleId',
     getAppuserids = '/sys/applicationInfo/getAppuserids',
     isInfoUser = '/sys/applicationInfo/isInfoUser',
     isAppAdminOrDevOrOpe = '/sys/applicationInfo/isAppAdminOrDevOrOpe',
@@ -71,6 +72,13 @@ export const getAppuserids = (params) =>{
 export const selectUserByDept = (params) =>{
   return defHttp.get({url: Api.selectUserByDept+"?id="+params})
 }
+
+// 根据角色获取用户信息(应用管理员下拉框使用)
+export const getUserListByRoleId = (params) =>{
+  return defHttp.get({url: Api.getUserListByRoleId+"?roleId="+params})
+}
+
+
 /**
  * 导出api
  * @param params

+ 0 - 4
jeecgboot-vue3/src/views/appmanage/AppBaseInfo.data.ts

@@ -476,10 +476,6 @@ export const listColumns2 =[
         title: '操作',
         key: 'action',
     },
-    {
-      title: '',
-      key: 'addType'
-    },
   // 非信息部用户看到的列
     {
       title: '业务对接人',

+ 1 - 1
jeecgboot-vue3/src/views/appmanage/AppInfoList.vue

@@ -43,7 +43,7 @@
               cancel-text="简易注册"
               @confirm="handleAdd('full')"
               @cancel="handleAdd('easy')">
-              <a-button type="primary" v-if="isInfoDeptUserTag" preIcon="ant-design:plus-outlined" style="margin-left: 320px">注 册</a-button>
+              <a-button type="primary" v-if="isInfoDeptUserTag" preIcon="ant-design:plus-outlined" style="margin-left: 60%">注 册</a-button>
             </a-popconfirm>
           </a-form-item>
         </a-form>

+ 48 - 6
jeecgboot-vue3/src/views/appmanage/addForm/Step1.vue

@@ -15,6 +15,22 @@
             @change="handleChange"
           ></a-select>
         </template>
+
+        <!-- 应用管理员信息从应用管理员角色已分配用户中获取 -->
+        <template #UserInfoByAppAdminRole="{model, field}">
+          <a-select
+            v-model:value="model[field]"
+            show-search
+            placeholder="选择用户"
+            style="width: 183px"
+            :options="appAdminUseroptions"
+            :filter-option="filterOption"
+            @focus="handleFocus"
+            @blur="handleBlur"
+            @change="handleChange"
+          ></a-select>
+        </template>
+
       </BasicForm>
       <div class="addFromButton">
         <a-button type="primary" @click="uncheck" v-if="!isFormType&&baseFormData?.isEdit" v-show="unCheckTag">反审核</a-button>
@@ -48,7 +64,14 @@ import {BasicForm, useForm} from '/@/components/Form';
 import {step1Schemas} from './data';
 import {Divider, Input, message, Select, SelectProps} from 'ant-design-vue';
 import {string} from "vue-types";
-import {editBaseInfo, getLock, saveOrUpdate, selectUserByDept, unLock} from '../AppBaseInfo.api'
+import {
+  editBaseInfo,
+  getLock,
+  getUserListByRoleId,
+  saveOrUpdate,
+  selectUserByDept,
+  unLock
+} from '../AppBaseInfo.api'
 import {useUserStore} from '@/store/modules/user'
 
 //设置变量储存登陆人信息
@@ -69,6 +92,7 @@ const [register, {setFieldsValue, getFieldsValue, validate }]  = useForm({
 const isFormType = ref(true)
 const unCheckTag = ref(true)
 const infoDeptUseroptions = ref<SelectProps['options']>([]);
+const appAdminUseroptions = ref<SelectProps['options']>([]);
   export default defineComponent({
     props: {
       addType: string,
@@ -139,8 +163,6 @@ const infoDeptUseroptions = ref<SelectProps['options']>([]);
         if (this.formType === 'isAdd'){  // 处于添加表单下的关闭事件,需收集表单已填数据进行存储
           if (tag === 'filling'){  // 填写过程中关闭表单,需要保存草稿数据
             obj.data = getFieldsValue()
-            console.log("注册过程填写数据关闭事件")
-            console.dir(obj.data)
             if ((obj.data as any).type === '') delete obj.data?.type
           }
         }else { // 处于编辑表单下的关闭事件
@@ -152,6 +174,12 @@ const infoDeptUseroptions = ref<SelectProps['options']>([]);
           }
           obj.type = 'isBaseFrom'
         }
+        console.log("表单一关闭时打印一下obj:")
+        console.dir(obj)
+        if((obj.data as any).name === "") delete (obj.data as any).name;
+        if((obj.data as any).status === undefined) delete (obj.data as any).status;
+        if((obj.data as any).type === undefined) delete (obj.data as any).type;
+        if((obj.data as any).admin === "") delete (obj.data as any).admin;
         this.$emit('closeModal',obj);
       },
 
@@ -170,6 +198,20 @@ const infoDeptUseroptions = ref<SelectProps['options']>([]);
           })
           infoDeptUseroptions.value = infoUserData
         })
+
+        // 设置应用管理员数据
+        await getUserListByRoleId('1828328255173709825').then(res => {
+          let infoUserData = []
+          res.forEach(item=>{
+            const obj = {
+              label: item.realname,
+              value: item.id
+            }
+            infoUserData.push(obj)
+          })
+          appAdminUseroptions.value = infoUserData
+        })
+
         let formData = {...this.baseFormData}
         // 作为新增表单的初始化
         if (this.formType === "isAdd"){
@@ -187,6 +229,7 @@ const infoDeptUseroptions = ref<SelectProps['options']>([]);
       async save(){
         // 获取编辑后的数据
         const values = await validate();
+        values.id = this.appid;
         await editBaseInfo(values).then(res =>{
           message.success("保存成功!")
           unCheckTag.value = true
@@ -196,12 +239,10 @@ const infoDeptUseroptions = ref<SelectProps['options']>([]);
 
       // 反审核按钮
       async uncheck(){
-        console.log("反审核:"+this.appid)
         await getLock("AppbaseInfo:"+this.appid).then((res: boolean) =>{
           res? message.error('当前信息处于反审核状态!') : message.success('反审核成功')
           unCheckTag.value = res
         })
-        console.log("反审核状态:"+unCheckTag)
       },
 
       // 退出反审核按钮
@@ -242,7 +283,8 @@ const infoDeptUseroptions = ref<SelectProps['options']>([]);
         handleBlur,
         handleFocus,
         handleChange,
-        infoDeptUseroptions
+        infoDeptUseroptions,
+        appAdminUseroptions
       };
     },
 

+ 1 - 0
jeecgboot-vue3/src/views/appmanage/addForm/Step4.vue

@@ -576,6 +576,7 @@ export default defineComponent({
      emit('add', addForm_newlyUserData.value)
      modalVisible.value=false
      data.value = []
+     addForm_newlyUserData.value = []
    }
 
     /**

+ 26 - 12
jeecgboot-vue3/src/views/appmanage/addForm/data.tsx

@@ -82,7 +82,7 @@ export const step1Schemas: FormSchema[] = [
     component: 'UserSelect',
     label: '应用管理员',
     required: true,
-    slot: 'UserInfoByInfoDept',
+    slot: 'UserInfoByAppAdminRole',
     defaultValue:'',
     colProps: {
       span: 8,
@@ -157,6 +157,20 @@ export const step1Schemas: FormSchema[] = [
     component: 'Input',
     show: false,
   },
+  // 应用注册类型(完整 or 简易)
+  {
+    label: '',
+    field: 'addType',
+    component: 'Input',
+    show: false,
+  },
+  // 审核状态(未审 or 已审)
+  {
+    label: '',
+    field: 'infoStatus',
+    component: 'Input',
+    show: false,
+  },
   {
     field: 'alwaysShow',
     label: '',
@@ -194,7 +208,7 @@ export const step2Schemas: FormSchema[] = [
       ],
     },
     colProps: {
-      span: 8,
+      span: 6,
     },
   },
   {
@@ -204,7 +218,7 @@ export const step2Schemas: FormSchema[] = [
     rules:[{ required: true, validator: isValidIp, trigger: 'blur' }],
     label: '前端部署IP',
     colProps: {
-      span: 8,
+      span: 7,
     },
   },
   {
@@ -238,11 +252,11 @@ export const step2Schemas: FormSchema[] = [
       return values.env === 'prod'
     },
     colProps: {
-      span: 18,
+      span: 16,
     },
   },
   {
-    field: 'dataBaseInfo',
+    field: 'databaseInfo',
     component: 'Input',
     label: '数据库信息',
     colProps: {
@@ -314,7 +328,7 @@ export const step2_1Schemas: FormSchema[] = [
       ],
     },
     colProps: {
-      span: 8,
+      span: 6,
     },
   },
   {
@@ -324,7 +338,7 @@ export const step2_1Schemas: FormSchema[] = [
     rules:[{ required: true, validator: isValidIp, trigger: 'blur' }],
     label: '前端部署IP',
     colProps: {
-      span: 8,
+      span: 7,
     },
   },
   {
@@ -358,11 +372,11 @@ export const step2_1Schemas: FormSchema[] = [
       return values.env === 'prod'
     },
     colProps: {
-      span: 18,
+      span: 16,
     },
   },
   {
-    field: 'dataBaseInfo',
+    field: 'databaseInfo',
     component: 'Input',
     label: '数据库信息',
     colProps: {
@@ -434,7 +448,7 @@ export const step2_2Schemas: FormSchema[] = [
       ],
     },
     colProps: {
-      span: 8,
+      span: 6,
     },
   },
   {
@@ -444,7 +458,7 @@ export const step2_2Schemas: FormSchema[] = [
     rules:[{ required: true, validator: isValidIp, trigger: 'blur' }],
     label: '前端部署IP',
     colProps: {
-      span: 8,
+      span: 7,
     },
   },
   {
@@ -482,7 +496,7 @@ export const step2_2Schemas: FormSchema[] = [
     },
   },
   {
-    field: 'dataBaseInfo',
+    field: 'databaseInfo',
     component: 'Input',
     label: '数据库信息',
     colProps: {

+ 0 - 1
jeecgboot-vue3/src/views/appmanage/addForm/index.vue

@@ -216,6 +216,5 @@ import {any, array, string} from "vue-types";
   }
 
   .mt-5{
-
   }
 </style>

+ 11 - 0
jeecgboot-vue3/src/views/integrityAppRegister/Demo.vue

@@ -0,0 +1,11 @@
+<script setup lang="ts">
+
+</script>
+
+<template>
+  <h1>完整应用注册示例一页面</h1>
+</template>
+
+<style scoped lang="less">
+
+</style>

+ 433 - 390
jeecgboot-vue3/src/views/system/loginmini/MiniLogin.vue

@@ -1,16 +1,16 @@
 <template>
   <div :class="prefixCls" class="login-background-img">
     <AppLocalePicker class="absolute top-4 right-4 enter-x xl:text-gray-600" :showText="false"/>
-    <AppDarkModeToggle class="absolute top-3 right-7 enter-x" />
+    <AppDarkModeToggle class="absolute top-3 right-7 enter-x"/>
     <div class="aui-logo" v-if="!getIsMobile">
       <div>
         <h3>
-          <img :src="logoImg" alt="jeecg" />
+          <img :src="logoImg" alt="jeecg"/>
         </h3>
       </div>
     </div>
     <div v-else class="aui-phone-logo">
-      <img :src="logoImg" alt="jeecg" />
+      <img :src="logoImg" alt="jeecg"/>
     </div>
     <div v-show="type === 'login'">
       <div class="aui-content">
@@ -18,69 +18,88 @@
           <div class="aui-form">
             <div class="aui-image">
               <div class="aui-image-text">
-                <img :src="adTextImg" />
+                <img :src="adTextImg"/>
               </div>
             </div>
             <div class="aui-formBox">
               <div class="aui-formWell">
                 <div class="aui-flex aui-form-nav investment_title">
-                  <div class="aui-flex-box" :class="activeIndex === 'accountLogin' ? 'activeNav on' : ''" @click="loginClick('accountLogin')"
-                    >{{ t('sys.login.signInFormTitle') }}
-                  </div>
-                  <div class="aui-flex-box" :class="activeIndex === 'phoneLogin' ? 'activeNav on' : ''" @click="loginClick('phoneLogin')"
-                    >{{ t('sys.login.mobileSignInFormTitle') }}
+                  <div class="aui-flex-box"
+                       :class="activeIndex === 'accountLogin' ? 'activeNav on' : ''"
+                       @click="loginClick('accountLogin')"
+                  >{{ t('sys.login.signInFormTitle') }}
                   </div>
+                  <!--                  <div class="aui-flex-box"-->
+                  <!--                       :class="activeIndex === 'phoneLogin' ? 'activeNav on' : ''"-->
+                  <!--                       @click="loginClick('phoneLogin')"-->
+                  <!--                  >{{ t('sys.login.mobileSignInFormTitle') }}-->
+                  <!--                  </div>-->
                 </div>
                 <div class="aui-form-box" style="height: 180px">
-                  <a-form ref="loginRef" :model="formData" v-if="activeIndex === 'accountLogin'" @keyup.enter.native="loginHandleClick">
+                  <a-form ref="loginRef" :model="formData" v-if="activeIndex === 'accountLogin'"
+                          @keyup.enter.native="loginHandleClick">
                     <div class="aui-account">
                       <div class="aui-inputClear">
                         <i class="icon icon-code"></i>
                         <a-form-item>
-                          <a-input class="fix-auto-fill" :placeholder="t('sys.login.userName')" v-model:value="formData.username" />
+                          <a-input class="fix-auto-fill" :placeholder="t('sys.login.userName')"
+                                   v-model:value="formData.username"/>
                         </a-form-item>
                       </div>
                       <div class="aui-inputClear">
                         <i class="icon icon-password"></i>
                         <a-form-item>
-                          <a-input class="fix-auto-fill" type="password" :placeholder="t('sys.login.password')" v-model:value="formData.password" />
+                          <a-input class="fix-auto-fill" type="password"
+                                   :placeholder="t('sys.login.password')"
+                                   v-model:value="formData.password"/>
                         </a-form-item>
                       </div>
-                      <div class="aui-inputClear">
-                        <i class="icon icon-code"></i>
-                        <a-form-item>
-                          <a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.inputCode')" v-model:value="formData.inputCode" />
-                        </a-form-item>
-                        <div class="aui-code">
-                          <img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
-                          <img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
-                        </div>
-                      </div>
-                      <div class="aui-flex">
-                        <div class="aui-flex-box">
-                          <div class="aui-choice">
-                            <a-input class="fix-auto-fill" type="checkbox" v-model:value="rememberMe" />
-                            <span style="margin-left: 5px">{{ t('sys.login.rememberMe') }}</span>
-                          </div>
-                        </div>
-                        <div class="aui-forget">
-                          <a @click="forgetHandelClick"> {{ t('sys.login.forgetPassword') }}</a>
-                        </div>
-                      </div>
+                      <!--                      <div class="aui-inputClear">-->
+                      <!--                        <i class="icon icon-code"></i>-->
+                      <!--                        <a-form-item>-->
+                      <!--                          <a-input class="fix-auto-fill" type="text"-->
+                      <!--                                   :placeholder="t('sys.login.inputCode')"-->
+                      <!--                                   v-model:value="formData.inputCode"/>-->
+                      <!--                        </a-form-item>-->
+                      <!--                        <div class="aui-code">-->
+                      <!--                          <img v-if="randCodeData.requestCodeSuccess"-->
+                      <!--                               :src="randCodeData.randCodeImage" @click="handleChangeCheckCode"/>-->
+                      <!--                          <img v-else style="margin-top: 2px; max-width: initial" :src="codeImg"-->
+                      <!--                               @click="handleChangeCheckCode"/>-->
+                      <!--                        </div>-->
+                      <!--                      </div>-->
+                      <!--                      <div class="aui-flex">-->
+                      <!--                        <div class="aui-flex-box">-->
+                      <!--                          <div class="aui-choice">-->
+                      <!--                            <a-input class="fix-auto-fill" type="checkbox"-->
+                      <!--                                     v-model:value="rememberMe"/>-->
+                      <!--                            <span style="margin-left: 5px">{{ t('sys.login.rememberMe') }}</span>-->
+                      <!--                          </div>-->
+                      <!--                        </div>-->
+                      <!--                        <div class="aui-forget">-->
+                      <!--                          <a @click="forgetHandelClick"> {{ t('sys.login.forgetPassword') }}</a>-->
+                      <!--                        </div>-->
+                      <!--                      </div>-->
                     </div>
                   </a-form>
-                  <a-form v-else ref="phoneFormRef" :model="phoneFormData" @keyup.enter.native="loginHandleClick">
+                  <a-form v-else ref="phoneFormRef" :model="phoneFormData"
+                          @keyup.enter.native="loginHandleClick">
                     <div class="aui-account phone">
                       <div class="aui-inputClear phoneClear">
-                        <a-input class="fix-auto-fill" :placeholder="t('sys.login.mobile')" v-model:value="phoneFormData.mobile" />
+                        <a-input class="fix-auto-fill" :placeholder="t('sys.login.mobile')"
+                                 v-model:value="phoneFormData.mobile"/>
                       </div>
                       <div class="aui-inputClear">
-                        <a-input class="fix-auto-fill" :maxlength="6" :placeholder="t('sys.login.smsCode')" v-model:value="phoneFormData.smscode" />
+                        <a-input class="fix-auto-fill" :maxlength="6"
+                                 :placeholder="t('sys.login.smsCode')"
+                                 v-model:value="phoneFormData.smscode"/>
                         <div v-if="showInterval" class="aui-code" @click="getLoginCode">
                           <a>{{ t('component.countdown.normalText') }}</a>
                         </div>
                         <div v-else class="aui-code">
-                          <span class="aui-get-code code-shape">{{ t('component.countdown.sendText', [unref(timeRuning)]) }}</span>
+                          <span class="aui-get-code code-shape">{{
+                              t('component.countdown.sendText', [unref(timeRuning)])
+                            }}</span>
                         </div>
                       </div>
                     </div>
@@ -88,402 +107,416 @@
                 </div>
                 <div class="aui-formButton">
                   <div class="aui-flex">
-                    <a-button :loading="loginLoading" class="aui-link-login" type="primary" @click="loginHandleClick">
-                      {{ t('sys.login.loginButton') }}</a-button>
-                  </div>
-                  <div class="aui-flex">
-                    <a class="aui-linek-code aui-flex-box" @click="codeHandleClick">{{ t('sys.login.qrSignInFormTitle') }}</a>
-                  </div>
-                  <div class="aui-flex">
-                    <a class="aui-linek-code aui-flex-box" @click="registerHandleClick">{{ t('sys.login.registerButton') }}</a>
+                    <a-button :loading="loginLoading" class="aui-link-login" type="primary"
+                              @click="loginHandleClick">
+                      {{ t('sys.login.loginButton') }}
+                    </a-button>
                   </div>
+                  <!--                  <div class="aui-flex">-->
+                  <!--                    <a class="aui-linek-code aui-flex-box" @click="codeHandleClick">{{ t('sys.login.qrSignInFormTitle') }}</a>-->
+                  <!--                  </div>-->
+                  <!--                  <div class="aui-flex">-->
+                  <!--                    <a class="aui-linek-code aui-flex-box" @click="registerHandleClick">{{ t('sys.login.registerButton') }}</a>-->
+                  <!--                  </div>-->
                 </div>
               </div>
-              <a-form @keyup.enter.native="loginHandleClick">
-                <div class="aui-flex aui-third-text">
-                  <div class="aui-flex-box aui-third-border">
-                    <span>{{ t('sys.login.otherSignIn') }}</span>
-                  </div>
-                </div>
-                <div class="aui-flex" :class="`${prefixCls}-sign-in-way`">
-                  <div class="aui-flex-box">
-                    <div class="aui-third-login">
-                      <a title="github" @click="onThirdLogin('github')"><GithubFilled /></a>
-                    </div>
-                  </div>
-                  <div class="aui-flex-box">
-                    <div class="aui-third-login">
-                      <a title="企业微信" @click="onThirdLogin('wechat_enterprise')"><icon-font class="item-icon" type="icon-qiyeweixin3" /></a>
-                    </div>
-                  </div>
-                  <div class="aui-flex-box">
-                    <div class="aui-third-login">
-                      <a title="钉钉" @click="onThirdLogin('dingtalk')"><DingtalkCircleFilled /></a>
-                    </div>
-                  </div>
-                  <div class="aui-flex-box">
-                    <div class="aui-third-login">
-                      <a title="微信" @click="onThirdLogin('wechat_open')"><WechatFilled /></a>
-                    </div>
-                  </div>
-                </div>
-              </a-form>
+              <!--              <a-form @keyup.enter.native="loginHandleClick">-->
+              <!--                <div class="aui-flex aui-third-text">-->
+              <!--                  <div class="aui-flex-box aui-third-border">-->
+              <!--                    <span>{{ t('sys.login.otherSignIn') }}</span>-->
+              <!--                  </div>-->
+              <!--                </div>-->
+              <!--                <div class="aui-flex" :class="`${prefixCls}-sign-in-way`">-->
+              <!--                  <div class="aui-flex-box">-->
+              <!--                    <div class="aui-third-login">-->
+              <!--                      <a title="github" @click="onThirdLogin('github')"><GithubFilled /></a>-->
+              <!--                    </div>-->
+              <!--                  </div>-->
+              <!--                  <div class="aui-flex-box">-->
+              <!--                    <div class="aui-third-login">-->
+              <!--                      <a title="企业微信" @click="onThirdLogin('wechat_enterprise')"><icon-font class="item-icon" type="icon-qiyeweixin3" /></a>-->
+              <!--                    </div>-->
+              <!--                  </div>-->
+              <!--                  <div class="aui-flex-box">-->
+              <!--                    <div class="aui-third-login">-->
+              <!--                      <a title="钉钉" @click="onThirdLogin('dingtalk')"><DingtalkCircleFilled /></a>-->
+              <!--                    </div>-->
+              <!--                  </div>-->
+              <!--                  <div class="aui-flex-box">-->
+              <!--                    <div class="aui-third-login">-->
+              <!--                      <a title="微信" @click="onThirdLogin('wechat_open')"><WechatFilled /></a>-->
+              <!--                    </div>-->
+              <!--                  </div>-->
+              <!--                </div>-->
+              <!--              </a-form>-->
             </div>
           </div>
         </div>
       </div>
     </div>
     <div v-show="type === 'forgot'" :class="`${prefixCls}-form`">
-      <MiniForgotpad ref="forgotRef" @go-back="goBack" @success="handleSuccess" />
+      <MiniForgotpad ref="forgotRef" @go-back="goBack" @success="handleSuccess"/>
     </div>
     <div v-show="type === 'register'" :class="`${prefixCls}-form`">
-      <MiniRegister ref="registerRef" @go-back="goBack" @success="handleSuccess" />
+      <MiniRegister ref="registerRef" @go-back="goBack" @success="handleSuccess"/>
     </div>
     <div v-show="type === 'codeLogin'" :class="`${prefixCls}-form`">
-      <MiniCodelogin ref="codeRef" @go-back="goBack" @success="handleSuccess" />
+      <MiniCodelogin ref="codeRef" @go-back="goBack" @success="handleSuccess"/>
     </div>
     <!-- 第三方登录相关弹框 -->
     <ThirdModal ref="thirdModalRef"></ThirdModal>
-    
+
     <!-- 图片验证码弹窗 -->
-    <CaptchaModal @register="captchaRegisterModal" @ok="getLoginCode" />
+    <CaptchaModal @register="captchaRegisterModal" @ok="getLoginCode"/>
   </div>
 </template>
 <script lang="ts" setup name="login-mini">
-  import { getCaptcha, getCodeInfo } from '/@/api/sys/user';
-  import { computed, onMounted, reactive, ref, toRaw, unref } from 'vue';
-  import codeImg from '/@/assets/images/checkcode.png';
-  import { Rule } from '/@/components/Form';
-  import { useUserStore } from '/@/store/modules/user';
-  import { useMessage } from '/@/hooks/web/useMessage';
-  import { useI18n } from '/@/hooks/web/useI18n';
-  import { SmsEnum } from '/@/views/sys/login/useLogin';
-  import ThirdModal from '/@/views/sys/login/ThirdModal.vue';
-  import MiniForgotpad from './MiniForgotpad.vue';
-  import MiniRegister from './MiniRegister.vue';
-  import MiniCodelogin from './MiniCodelogin.vue';
-  import logoImg from '/@/assets/loginmini/icon/jeecg_logo.png';
-  import adTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
-  import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
-  import { useLocaleStore } from '/@/store/modules/locale';
-  import { useDesign } from "/@/hooks/web/useDesign";
-  import { useAppInject } from "/@/hooks/web/useAppInject";
-  import { GithubFilled, WechatFilled, DingtalkCircleFilled, createFromIconfontCN } from '@ant-design/icons-vue';
-  import CaptchaModal from '@/components/jeecg/captcha/CaptchaModal.vue';
-  import { useModal } from "@/components/Modal";
-  import { ExceptionEnum } from "@/enums/exceptionEnum";
-
-  const IconFont = createFromIconfontCN({
-    scriptUrl: '//at.alicdn.com/t/font_2316098_umqusozousr.js',
-  });
-  const { prefixCls } = useDesign('mini-login');
-  const { notification, createMessage } = useMessage();
-  const userStore = useUserStore();
-  const { t } = useI18n();
-  const localeStore = useLocaleStore();
-  const showLocale = localeStore.getShowPicker;
-  const randCodeData = reactive<any>({
-    randCodeImage: '',
-    requestCodeSuccess: false,
-    checkKey: null,
-  });
-  const rememberMe = ref<string>('0');
-  //手机号登录还是账号登录
-  const activeIndex = ref<string>('accountLogin');
-  const type = ref<string>('login');
-  //账号登录表单字段
-  const formData = reactive<any>({
-    inputCode: '',
-    username: 'admin',
-    password: '123456',
-  });
-  //手机登录表单字段
-  const phoneFormData = reactive<any>({
-    mobile: '',
-    smscode: '',
-  });
-  const loginRef = ref();
-  //第三方登录弹窗
-  const thirdModalRef = ref();
-  //扫码登录
-  const codeRef = ref();
-  //是否显示获取验证码
-  const showInterval = ref<boolean>(true);
-  //60s
-  const timeRuning = ref<number>(60);
-  //定时器
-  const timer = ref<any>(null);
-  //忘记密码
-  const forgotRef = ref();
-  //注册
-  const registerRef = ref();
-  const loginLoading = ref<boolean>(false);
-  const { getIsMobile } = useAppInject();
-  const [captchaRegisterModal, { openModal: openCaptchaModal }] = useModal();
-  defineProps({
-    sessionTimeout: {
-      type: Boolean,
-    },
+import {getCaptcha, getCodeInfo} from '/@/api/sys/user';
+import {computed, onMounted, reactive, ref, toRaw, unref} from 'vue';
+import codeImg from '/@/assets/images/checkcode.png';
+import {Rule} from '/@/components/Form';
+import {useUserStore} from '/@/store/modules/user';
+import {useMessage} from '/@/hooks/web/useMessage';
+import {useI18n} from '/@/hooks/web/useI18n';
+import {SmsEnum} from '/@/views/sys/login/useLogin';
+import ThirdModal from '/@/views/sys/login/ThirdModal.vue';
+import MiniForgotpad from './MiniForgotpad.vue';
+import MiniRegister from './MiniRegister.vue';
+import MiniCodelogin from './MiniCodelogin.vue';
+import logoImg from '/@/assets/loginmini/icon/jeecg_logo.png';
+import adTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
+import {AppLocalePicker, AppDarkModeToggle} from '/@/components/Application';
+import {useLocaleStore} from '/@/store/modules/locale';
+import {useDesign} from "/@/hooks/web/useDesign";
+import {useAppInject} from "/@/hooks/web/useAppInject";
+import {
+  GithubFilled,
+  WechatFilled,
+  DingtalkCircleFilled,
+  createFromIconfontCN
+} from '@ant-design/icons-vue';
+import CaptchaModal from '@/components/jeecg/captcha/CaptchaModal.vue';
+import {useModal} from "@/components/Modal";
+import {ExceptionEnum} from "@/enums/exceptionEnum";
+
+const IconFont = createFromIconfontCN({
+  scriptUrl: '//at.alicdn.com/t/font_2316098_umqusozousr.js',
+});
+const {prefixCls} = useDesign('mini-login');
+const {notification, createMessage} = useMessage();
+const userStore = useUserStore();
+const {t} = useI18n();
+const localeStore = useLocaleStore();
+const showLocale = localeStore.getShowPicker;
+const randCodeData = reactive<any>({
+  randCodeImage: '',
+  requestCodeSuccess: false,
+  checkKey: null,
+});
+const rememberMe = ref<string>('0');
+//手机号登录还是账号登录
+const activeIndex = ref<string>('accountLogin');
+const type = ref<string>('login');
+//账号登录表单字段
+const formData = reactive<any>({
+  // inputCode: '',
+  username: '',
+  password: '',
+});
+//手机登录表单字段
+const phoneFormData = reactive<any>({
+  mobile: '',
+  smscode: '',
+});
+const loginRef = ref();
+//第三方登录弹窗
+const thirdModalRef = ref();
+//扫码登录
+const codeRef = ref();
+//是否显示获取验证码
+const showInterval = ref<boolean>(true);
+//60s
+const timeRuning = ref<number>(60);
+//定时器
+const timer = ref<any>(null);
+//忘记密码
+const forgotRef = ref();
+//注册
+const registerRef = ref();
+const loginLoading = ref<boolean>(false);
+const {getIsMobile} = useAppInject();
+const [captchaRegisterModal, {openModal: openCaptchaModal}] = useModal();
+defineProps({
+  sessionTimeout: {
+    type: Boolean,
+  },
+});
+
+/**
+ * 获取验证码
+ */
+function handleChangeCheckCode() {
+  // formData.inputCode = '';
+
+  randCodeData.checkKey = 1629428467008;
+  getCodeInfo(randCodeData.checkKey).then((res) => {
+    randCodeData.randCodeImage = res;
+    randCodeData.requestCodeSuccess = true;
   });
+}
 
-  /**
-   * 获取验证码
-   */
-  function handleChangeCheckCode() {
-    formData.inputCode = '';
+/**
+ * 切换登录方式
+ */
+function loginClick(type) {
+  activeIndex.value = type;
+}
 
-    randCodeData.checkKey = 1629428467008;
-    getCodeInfo(randCodeData.checkKey).then((res) => {
-      randCodeData.randCodeImage = res;
-      randCodeData.requestCodeSuccess = true;
-    });
+/**
+ * 账号或者手机登录
+ */
+async function loginHandleClick() {
+  if (unref(activeIndex) === 'accountLogin') {
+    accountLogin();
+  } else {
+    //手机号登录
+    phoneLogin();
   }
+}
 
-  /**
-   * 切换登录方式
-   */
-  function loginClick(type) {
-    activeIndex.value = type;
+async function accountLogin() {
+  if (!formData.username) {
+    createMessage.warn(t('sys.login.accountPlaceholder'));
+    return;
   }
-
-  /**
-   * 账号或者手机登录
-   */
-  async function loginHandleClick() {
-    if (unref(activeIndex) === 'accountLogin') {
-      accountLogin();
-    } else {
-      //手机号登录
-      phoneLogin();
-    }
+  if (!formData.password) {
+    createMessage.warn(t('sys.login.passwordPlaceholder'));
+    return;
   }
-
-  async function accountLogin() {
-    if (!formData.username) {
-      createMessage.warn(t('sys.login.accountPlaceholder'));
-      return;
-    }
-    if (!formData.password) {
-      createMessage.warn(t('sys.login.passwordPlaceholder'));
-      return;
-    }
-    try {
-      loginLoading.value = true;
-      const { userInfo } = await userStore.login(
-        toRaw({
-          password: formData.password,
-          username: formData.username,
-          captcha: formData.inputCode,
-          checkKey: randCodeData.checkKey,
-          mode: 'none', //不要默认的错误提示
-        })
-      );
-      if (userInfo) {
-        notification.success({
-          message: t('sys.login.loginSuccessTitle'),
-          description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
-          duration: 3,
-        });
-      }
-    } catch (error) {
-      notification.error({
-        message: t('sys.api.errorTip'),
-        description: error.message || t('sys.login.networkExceptionMsg'),
+  try {
+    loginLoading.value = true;
+    const {userInfo} = await userStore.login(
+      toRaw({
+        password: formData.password,
+        username: formData.username,
+        // captcha: formData.inputCode,
+        // checkKey: randCodeData.checkKey,
+        mode: 'none', //不要默认的错误提示
+      })
+    );
+    if (userInfo) {
+      notification.success({
+        message: t('sys.login.loginSuccessTitle'),
+        description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
         duration: 3,
       });
-      handleChangeCheckCode();
-    } finally {
-      loginLoading.value = false;
     }
+  } catch (error) {
+    notification.error({
+      message: t('sys.api.errorTip'),
+      description: error.message || t('sys.login.networkExceptionMsg'),
+      duration: 3,
+    });
+    // handleChangeCheckCode();
+  } finally {
+    loginLoading.value = false;
   }
+}
 
-  /**
-   * 手机号登录
-   */
-  async function phoneLogin() {
-    if (!phoneFormData.mobile) {
-      createMessage.warn(t('sys.login.mobilePlaceholder'));
-      return;
-    }
-    if (!phoneFormData.smscode) {
-      createMessage.warn(t('sys.login.smsPlaceholder'));
-      return;
-    }
-    try {
-      loginLoading.value = true;
-      const { userInfo }: any = await userStore.phoneLogin({
-        mobile: phoneFormData.mobile,
-        captcha: phoneFormData.smscode,
-        mode: 'none', //不要默认的错误提示
-      });
-      if (userInfo) {
-        notification.success({
-          message: t('sys.login.loginSuccessTitle'),
-          description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
-          duration: 3,
-        });
-      }
-    } catch (error) {
-      notification.error({
-        message: t('sys.api.errorTip'),
-        description: error.message || t('sys.login.networkExceptionMsg'),
+/**
+ * 手机号登录
+ */
+async function phoneLogin() {
+  if (!phoneFormData.mobile) {
+    createMessage.warn(t('sys.login.mobilePlaceholder'));
+    return;
+  }
+  if (!phoneFormData.smscode) {
+    createMessage.warn(t('sys.login.smsPlaceholder'));
+    return;
+  }
+  try {
+    loginLoading.value = true;
+    const {userInfo}: any = await userStore.phoneLogin({
+      mobile: phoneFormData.mobile,
+      captcha: phoneFormData.smscode,
+      mode: 'none', //不要默认的错误提示
+    });
+    if (userInfo) {
+      notification.success({
+        message: t('sys.login.loginSuccessTitle'),
+        description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
         duration: 3,
       });
-    } finally {
-      loginLoading.value = false;
     }
+  } catch (error) {
+    notification.error({
+      message: t('sys.api.errorTip'),
+      description: error.message || t('sys.login.networkExceptionMsg'),
+      duration: 3,
+    });
+  } finally {
+    loginLoading.value = false;
   }
+}
 
-  /**
-   * 获取手机验证码
-   */
-  async function getLoginCode() {
-    if (!phoneFormData.mobile) {
-      createMessage.warn(t('sys.login.mobilePlaceholder'));
-      return;
+/**
+ * 获取手机验证码
+ */
+async function getLoginCode() {
+  if (!phoneFormData.mobile) {
+    createMessage.warn(t('sys.login.mobilePlaceholder'));
+    return;
+  }
+  //update-begin---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
+  const result = await getCaptcha({
+    mobile: phoneFormData.mobile,
+    smsmode: SmsEnum.FORGET_PASSWORD
+  }).catch((res) => {
+    if (res.code === ExceptionEnum.PHONE_SMS_FAIL_CODE) {
+      openCaptchaModal(true, {});
     }
-    //update-begin---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
-    const result = await getCaptcha({ mobile: phoneFormData.mobile, smsmode: SmsEnum.FORGET_PASSWORD }).catch((res) =>{
-      if(res.code === ExceptionEnum.PHONE_SMS_FAIL_CODE){
-        openCaptchaModal(true, {});
-      }
-    });
-    //update-end---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
-    if (result) {
-      const TIME_COUNT = 60;
-      if (!unref(timer)) {
-        timeRuning.value = TIME_COUNT;
-        showInterval.value = false;
-        timer.value = setInterval(() => {
-          if (unref(timeRuning) > 0 && unref(timeRuning) <= TIME_COUNT) {
-            timeRuning.value = timeRuning.value - 1;
-          } else {
-            showInterval.value = true;
-            clearInterval(unref(timer));
-            timer.value = null;
-          }
-        }, 1000);
-      }
+  });
+  //update-end---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
+  if (result) {
+    const TIME_COUNT = 60;
+    if (!unref(timer)) {
+      timeRuning.value = TIME_COUNT;
+      showInterval.value = false;
+      timer.value = setInterval(() => {
+        if (unref(timeRuning) > 0 && unref(timeRuning) <= TIME_COUNT) {
+          timeRuning.value = timeRuning.value - 1;
+        } else {
+          showInterval.value = true;
+          clearInterval(unref(timer));
+          timer.value = null;
+        }
+      }, 1000);
     }
   }
+}
 
-  /**
-   * 第三方登录
-   * @param type
-   */
-  function onThirdLogin(type) {
-    thirdModalRef.value.onThirdLogin(type);
-  }
+/**
+ * 第三方登录
+ * @param type
+ */
+function onThirdLogin(type) {
+  thirdModalRef.value.onThirdLogin(type);
+}
 
-  /**
-   * 忘记密码
-   */
-  function forgetHandelClick() {
-    type.value = 'forgot';
-    setTimeout(() => {
-      forgotRef.value.initForm();
-    }, 300);
-  }
+/**
+ * 忘记密码
+ */
+function forgetHandelClick() {
+  type.value = 'forgot';
+  setTimeout(() => {
+    forgotRef.value.initForm();
+  }, 300);
+}
 
-  /**
-   * 返回登录页面
-   */
-  function goBack() {
-    activeIndex.value = 'accountLogin';
-    type.value = 'login';
-  }
+/**
+ * 返回登录页面
+ */
+function goBack() {
+  activeIndex.value = 'accountLogin';
+  type.value = 'login';
+}
 
-  /**
-   * 忘记密码/注册账号回调事件
-   * @param value
-   */
-  function handleSuccess(value) {
-    Object.assign(formData, value);
-    Object.assign(phoneFormData, { mobile: "", smscode: "" });
-    type.value = 'login';
-    activeIndex.value = 'accountLogin';
-    handleChangeCheckCode();
-  }
+/**
+ * 忘记密码/注册账号回调事件
+ * @param value
+ */
+function handleSuccess(value) {
+  Object.assign(formData, value);
+  Object.assign(phoneFormData, {mobile: "", smscode: ""});
+  type.value = 'login';
+  activeIndex.value = 'accountLogin';
+  handleChangeCheckCode();
+}
 
-  /**
-   * 注册
-   */
-  function registerHandleClick() {
-    type.value = 'register';
-    setTimeout(() => {
-      registerRef.value.initForm();
-    }, 300);
-  }
+/**
+ * 注册
+ */
+function registerHandleClick() {
+  type.value = 'register';
+  setTimeout(() => {
+    registerRef.value.initForm();
+  }, 300);
+}
 
-  /**
-   * 注册
-   */
-  function codeHandleClick() {
-    type.value = 'codeLogin';
-    setTimeout(() => {
-      codeRef.value.initFrom();
-    }, 300);
-  }
+/**
+ * 注册
+ */
+function codeHandleClick() {
+  type.value = 'codeLogin';
+  setTimeout(() => {
+    codeRef.value.initFrom();
+  }, 300);
+}
 
-  onMounted(() => {
-    //加载验证码
-    handleChangeCheckCode();
-  });
+onMounted(() => {
+  //加载验证码
+  // handleChangeCheckCode();
+});
 </script>
 
 <style lang="less" scoped>
-  @import '/@/assets/loginmini/style/home.less';
-  @import '/@/assets/loginmini/style/base.less';
+@import '/@/assets/loginmini/style/home.less';
+@import '/@/assets/loginmini/style/base.less';
 
-  :deep(.ant-input:focus) {
-    box-shadow: none;
-  }
-  .aui-get-code {
-    float: right;
-    position: relative;
-    z-index: 3;
-    background: #ffffff;
-    color: #1573e9;
-    border-radius: 100px;
-    padding: 5px 16px;
-    margin: 7px;
-    border: 1px solid #1573e9;
-    top: 12px;
-  }
+:deep(.ant-input:focus) {
+  box-shadow: none;
+}
 
-  .aui-get-code:hover {
-    color: #1573e9;
-  }
+.aui-get-code {
+  float: right;
+  position: relative;
+  z-index: 3;
+  background: #ffffff;
+  color: #1573e9;
+  border-radius: 100px;
+  padding: 5px 16px;
+  margin: 7px;
+  border: 1px solid #1573e9;
+  top: 12px;
+}
 
-  .code-shape {
-    border-color: #dadada !important;
-    color: #aaa !important;
-  }
+.aui-get-code:hover {
+  color: #1573e9;
+}
 
-  :deep(.jeecg-dark-switch){
-    position:absolute;
-    margin-right: 10px;
-  }
-  .aui-link-login{
-    height: 42px;
-    padding: 10px 15px;
-    font-size: 14px;
-    border-radius: 8px;
-    margin-top: 15px;
-    margin-bottom: 8px;
-    flex: 1;
-    color: #fff;
-  }
-  .aui-phone-logo{
-    position: absolute;
-    margin-left: 10px;
-    width: 60px;
-    top:2px;
-    z-index: 4;
-  }
-  .top-3{
-    top: 0.45rem;
-  }
+.code-shape {
+  border-color: #dadada !important;
+  color: #aaa !important;
+}
+
+:deep(.jeecg-dark-switch) {
+  position: absolute;
+  margin-right: 10px;
+}
+
+.aui-link-login {
+  height: 42px;
+  padding: 10px 15px;
+  font-size: 14px;
+  border-radius: 8px;
+  margin-top: -5vh;
+  margin-bottom: 8px;
+  flex: 1;
+  color: #fff;
+}
+
+.aui-phone-logo {
+  position: absolute;
+  margin-left: 10px;
+  width: 60px;
+  top: 2px;
+  z-index: 4;
+}
+
+.top-3 {
+  top: 0.45rem;
+}
 </style>
 
 <style lang="less">
@@ -498,9 +531,11 @@ html[data-theme='dark'] {
     &::before {
       background-image: url(/@/assets/svg/login-bg-dark.svg);
     }
-    .aui-inputClear{
+
+    .aui-inputClear {
       background-color: #232a3b !important;
     }
+
     .ant-input,
     .ant-input-password {
       background-color: #232a3b !important;
@@ -517,30 +552,36 @@ html[data-theme='dark'] {
     .app-iconify {
       color: #fff !important;
     }
-    .aui-inputClear input,.aui-input-line input,.aui-choice{
+
+    .aui-inputClear input, .aui-input-line input, .aui-choice {
       color: #c9d1d9 !important;
     }
 
-    .aui-formBox{
+    .aui-formBox {
       background-color: @dark-bg !important;
     }
-    .aui-third-text span{
+
+    .aui-third-text span {
       background-color: @dark-bg !important;
     }
-    .aui-form-nav .aui-flex-box{
+
+    .aui-form-nav .aui-flex-box {
       color: #c9d1d9 !important;
     }
 
-    .aui-formButton .aui-linek-code{
-      background:  @dark-bg !important;
+    .aui-formButton .aui-linek-code {
+      background: @dark-bg !important;
       color: white !important;
     }
-    .aui-code-line{
+
+    .aui-code-line {
       border-left: none !important;
     }
-    .ant-checkbox-inner,.aui-success h3{
+
+    .ant-checkbox-inner, .aui-success h3 {
       border-color: #c9d1d9;
     }
+
     //update-begin---author:wangshuai ---date:20230828  for:【QQYUN-6363】这个样式代码有问题,不在里面,导致表达式有问题------------
     &-sign-in-way {
       .anticon {
@@ -553,6 +594,7 @@ html[data-theme='dark'] {
         }
       }
     }
+
     //update-end---author:wangshuai ---date:20230828  for:【QQYUN-6363】这个样式代码有问题,不在里面,导致表达式有问题------------
   }
 
@@ -561,12 +603,13 @@ html[data-theme='dark'] {
     -webkit-text-fill-color: #c9d1d9 !important;
     box-shadow: inherit !important;
   }
-  
+
   .ant-divider-inner-text {
     font-size: 12px !important;
     color: @text-color-secondary !important;
   }
-  .aui-third-login a{
+
+  .aui-third-login a {
     background: transparent;
   }
 }