22 Commits e1d51d69e2 ... 0a15dfe3af

Author SHA1 Message Date
  GDW 0a15dfe3af BUG修复:##13501 用户管理-编辑页面删除性别字段值,提示“修改成功”后,详情页依旧显示改字段值问题 2 weeks ago
  GDW cf65593ae1 BUG修复:#13423 用户管理-BUG:回收站删除操作,已选中记录未更新问题(同用户列表删除问题) 3 weeks ago
  GDW 0efdf3c401 BUG修复:#13421 用户管理-BUG:用户信息列表删除时,已选中记录数量未变更问题 3 weeks ago
  GDW 7e19fa96cd BUG修复:#13420 用户管理-取消关键字搜索,不点击搜索按钮,自动刷新页面显示全部部门信息(优化建议) 3 weeks ago
  GDW a065eba32e BUG修复:#13375 用户管理-页面展示,每次切换用户信息表格页面,空格大小都不同 3 weeks ago
  GDW fe1e4019d5 BUG修复:#13359 部门管理-搜索框关键字搜索BUG:取消关键字,默认勾选了子节点 3 weeks ago
  GDW 2ce3d0327b BUG修复:#13346 部门管理-取消关键字时,是否可以直接刷新页面(优化建议) 3 weeks ago
  GDW cf7bf8e07e BUG修复:#13371 部门管理-删除部门时,已选中记录未更新,且再次选中子节点时累加问题 3 weeks ago
  GDW 554b4cb991 BUG修复:BUG#13371 取消父节点勾选,所有子节点未取消勾选问题及已选中数量记录问题问题修复 3 weeks ago
  ZL 3704e624c6 新增角色组件样式修改 3 weeks ago
  ZL 069e4a9268 Merge remote-tracking branch 'origin/dev' into ZL 3 weeks ago
  ZL f8e2aa8bd2 更换新增角色应用组件 3 weeks ago
  LT32820A dcec7eabc5 Merge remote-tracking branch 'origin/dev' into dev 3 weeks ago
  LT32820A 313412a1cf 解决 JFlow中角色数据使用的是JeecgBoot平台职务管理中的数据的问题 补充提交(前端) 3 weeks ago
  LT32820A 4b11d2b9ba 解决 JFlow中角色数据使用的是JeecgBoot平台职务管理中的数据的问题 3 weeks ago
  LT32820A dc906ed061 更新 'jeecg-boot/jeecg-server-cloud/jflow-cloud-start/src/main/java/org/jeecg/config/DevelopAPI.java' 4 weeks ago
  LT32820A dd425fc492 更新 'jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java' 4 weeks ago
  LT32820A e7f0b461ed 更新 'jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/filters/JwtFilter.java' 4 weeks ago
  LT32820A e5dd4b0a01 JFlow与Jeecg登录时效性不一致问题解决-补充提交(更改设置JFlow Token有效期) 4 weeks ago
  LT32820A 0b404caf2a Merge remote-tracking branch 'origin/dev' into dev 4 weeks ago
  LT32820A ac7e20b2f6 JFlow与Jeecg登录时效性不一致问题解决 4 weeks ago
  LT32820A 98ae6222a5 JFlow与Jeecg登录时效性不一致问题解决 4 weeks ago
18 changed files with 234 additions and 139 deletions
  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. 1 1
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/AppmanageEntity/AppBaseInfo.java
  4. 16 6
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/AppCustomMapper.java
  5. 71 66
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/AppmanageServiceImpl.java
  6. 1 1
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/util/AppManageUtil.java
  7. 9 3
      jeecg-boot/jeecg-server-cloud/jflow-cloud-start/src/main/java/org/jeecg/config/DevelopAPI.java
  8. 2 12
      jeecg-boot/jflow-core/src/main/java/bp/wf/Dev2Interface.java
  9. 1 1
      jeecgboot-vue3/src/api/sys/user.ts
  10. 4 4
      jeecgboot-vue3/src/store/modules/user.ts
  11. 1 0
      jeecgboot-vue3/src/views/appmanage/addForm/Step1.vue
  12. 22 8
      jeecgboot-vue3/src/views/appmanage/addForm/data.tsx
  13. 57 5
      jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue
  14. 2 2
      jeecgboot-vue3/src/views/system/depart/index.vue
  15. 6 21
      jeecgboot-vue3/src/views/system/role/role.data.ts
  16. 14 0
      jeecgboot-vue3/src/views/system/user/UserRecycleBinModal.vue
  17. 14 3
      jeecgboot-vue3/src/views/system/user/index.vue
  18. 2 0
      jeecgboot-vue3/src/views/system/user/user.data.ts

+ 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进行登入,如果错误他会抛出异常并被捕获

+ 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;
     // 用于当前用户是否可以编辑该条信息

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

@@ -1,9 +1,6 @@
 package org.jeecg.modules.system.mapper;
 
-import org.apache.ibatis.annotations.Delete;
-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;
@@ -20,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}")
@@ -74,4 +71,17 @@ public interface AppCustomMapper {
     // 通过应用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);
+
 }

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

@@ -232,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;
@@ -245,8 +247,8 @@ public class AppmanageServiceImpl implements AppmanageService {
      */
     @Override
     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;
@@ -607,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()));
     }
 
@@ -670,71 +672,74 @@ 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","应用"+appBaseInfo.getName()+"注册审核通过");
-        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()+"_默认用户角色");  // 设置角色名
-            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(),"");
+
+        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);
         }
     }
 

+ 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());

+ 2 - 12
jeecg-boot/jflow-core/src/main/java/bp/wf/Dev2Interface.java

@@ -3858,7 +3858,6 @@ public class Dev2Interface
 
 	/**
 	 按照token登录 2021.07.01 采用新方式.
-
 	 @param token
 	*/
 	public static String Port_LoginByToken(String token)
@@ -4058,8 +4057,6 @@ public class Dev2Interface
 			return;
 		}
 
-
-
 		if (emp.getOrgNo().equals(orgNo) == false)
 		{
 			//如果选择的组织不存在,就从他的隶属部门里去找一个部门。
@@ -4069,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);
 	}
@@ -4189,7 +4183,6 @@ public class Dev2Interface
 			tk.setSheBei(1);
 		}
 		tk.Insert();
-
 		WebUser.setToken(tk.getMyPK());
 		return tk.getMyPK();
 	}
@@ -4298,7 +4291,7 @@ public class Dev2Interface
 
 		if (activeMinutes == 0)
 		{
-			activeMinutes = 300; //默认为300分钟.
+			activeMinutes = 10080; //默认为七天
 		}
 
 		String key = "Token_" + logDev; //para的参数.
@@ -4319,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)

+ 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 - 0
jeecgboot-vue3/src/views/appmanage/addForm/Step1.vue

@@ -229,6 +229,7 @@ const appAdminUseroptions = ref<SelectProps['options']>([]);
       async save(){
         // 获取编辑后的数据
         const values = await validate();
+        values.id = this.appid;
         await editBaseInfo(values).then(res =>{
           message.success("保存成功!")
           unCheckTag.value = true

+ 22 - 8
jeecgboot-vue3/src/views/appmanage/addForm/data.tsx

@@ -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,7 +252,7 @@ export const step2Schemas: FormSchema[] = [
       return values.env === 'prod'
     },
     colProps: {
-      span: 18,
+      span: 16,
     },
   },
   {
@@ -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,7 +372,7 @@ export const step2_1Schemas: FormSchema[] = [
       return values.env === 'prod'
     },
     colProps: {
-      span: 18,
+      span: 16,
     },
   },
   {
@@ -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,
     },
   },
   {

+ 57 - 5
jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue

@@ -42,7 +42,7 @@
       </template>
     </a-alert>
     <a-spin :spinning="loading">
-      <a-input-search placeholder="按部门名称搜索…" style="margin-bottom: 10px" @search="onSearch" />
+      <a-input-search placeholder="按部门名称搜索…" style="margin-bottom: 10px" v-model:value="searchValue" @search="onSearch" />
       <!--组织机构树-->
       <template v-if="treeData.length > 0">
         <a-tree
@@ -86,12 +86,12 @@
       </template>
       <a-empty v-else description="暂无数据" />
     </a-spin>
-    <DepartFormModal :rootTreeData="treeData" @register="registerModal" @success="loadRootTreeData" />
+    <DepartFormModal :rootTreeData="treeData" @register="registerModal" @success="onSaveSuccess" />
   </a-card>
 </template>
 
 <script lang="ts" setup>
-  import { inject, nextTick, ref, unref } from 'vue';
+import {inject, nextTick, ref, unref, watch} from 'vue';
   import { useModal } from '/@/components/Modal';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useMethods } from '/@/hooks/system/useMethods';
@@ -128,10 +128,20 @@
   const isUnfold = ref(false)
   // 需要展开
   const needExpand = ref<string[]>([])
+  //部门搜索值
+  const searchValue = ref('');
 
   // 注册 modal
   const [registerModal, { openModal }] = useModal();
 
+  //保存成功后执行
+  function onSaveSuccess() {
+    checkedKeys.value = [];
+    expandedKeys.value = [];
+    isUnfold.value = false;
+    loadRootTreeData();
+  }
+
   // 加载顶级部门信息
   async function loadRootTreeData() {
     try {
@@ -255,6 +265,10 @@
     const record = { parentId: data.id };
     openModal(true, { isUpdate: false, isChild: true, record });
   }
+  //监听搜索框内值的变化
+  watch(searchValue, (newVal) => {
+    onSearch(newVal)
+  });
 
   // 搜索事件
   async function onSearch(value: string) {
@@ -279,11 +293,21 @@
   // 树复选框选择事件
   function onCheck(checked, info) {
     // console.log(info.node.children.length)
+    // console.log(info.checked)
+    // console.log(info.node)
+
+    // console.log(checked)
+
     if (Array.isArray(checked)) {
       checkedKeys.value = checked;
     } else {
       checkedKeys.value = checked.checked;
     }
+
+    if (!info.checked) {
+      onCheckCancel(info.node)
+    }
+
     // console.log(Array.isArray(checked))
     // console.log(checked)
     // console.log(checked.checked)
@@ -305,13 +329,34 @@
   //已加载的节点也选中
   function onCheckedKeys(node) {
     for (let i = 0; i < node.children.length; i++) {
+      //去重,防止重复选中
+      if (checkedKeys.value.indexOf(node.children[i].key) === -1) {
+        checkedKeys.value.push(node.children[i].key)
+      }
+      // checkedKeys.value.push(node.children[i].key)
       expandedKeys.value.push(node.children[i].key)
-      checkedKeys.value.push(node.children[i].key)
       if (node.children[i].children.length > 0) {
         onCheckedKeys(node.children[i])
       }
     }
   }
+
+  //父结点取消选择后,子节点也取消选择
+  function onCheckCancel(node) {
+    console.log('取消选择')
+    for (let i = 0; i < node.children.length; i++) {
+      let index = checkedKeys.value.indexOf(node.children[i].key);
+      if (index !== -1) {
+        checkedKeys.value.splice(index, 1); // 移除选中的键
+      }
+      // expandedKeys.value.push(node.children[i].key)
+      // checkedKeys.value.push(node.children[i].key)
+      if (node.children[i].children.length > 0) {
+        onCheckCancel(node.children[i])
+      }
+    }
+    // console.log(checkedKeys.value)
+  }
 /**
   function onCheck(checked, info) {
     console.log(checked)
@@ -335,7 +380,7 @@
 
   // 树选择事件
   function onSelect(selKeys, event) {
-    console.log('select: ', selKeys, event);
+    // console.log('select: ', selKeys, event);
     if (selKeys.length > 0 && selectedKeys.value[0] !== selKeys[0]) {
       setSelectedKey(selKeys[0], event.selectedNodes[0]);
     } else {
@@ -356,6 +401,12 @@
         loading.value = true;
         await deleteBatchDepart({ ids: idList.join(',') }, confirm);
         await loadRootTreeData();
+        await idList.forEach((id) => {
+          let index = checkedKeys.value.indexOf(id);
+          if (index !== -1) {
+            checkedKeys.value.splice(index, 1); // 移除选中的键
+          }
+        })
       } finally {
         loading.value = false;
       }
@@ -405,5 +456,6 @@
 
   defineExpose({
     loadRootTreeData,
+    onSaveSuccess,
   });
 </script>

+ 2 - 2
jeecgboot-vue3/src/views/system/depart/index.vue

@@ -44,7 +44,7 @@
 
   // 左侧树选择后触发
   function onTreeSelect(data) {
-    console.log('onTreeSelect: ', data);
+    // console.log('onTreeSelect: ', data);
     departData.value = data;
   }
 
@@ -54,7 +54,7 @@
   }
 
   function onSuccess() {
-    leftTree.value.loadRootTreeData();
+    leftTree.value.onSaveSuccess();
   }
 </script>
 

+ 6 - 21
jeecgboot-vue3/src/views/system/role/role.data.ts

@@ -132,17 +132,6 @@ export const searchUsermodelSchema: FormSchema[] = [
 
 ];
 
-export const onCleanCode = (formRef: any) => {
-  console.log('cleanCode');
-  console.log('formRef.value', formRef);
-  if (formRef) {
-    formRef.setFieldsValue({
-      roleCode: '',
-    })
-    console.log('formRef.value', formRef.validate);
-
-  }
-};
 
 export const formSchema: FormSchema[] = [
   {
@@ -154,19 +143,15 @@ export const formSchema: FormSchema[] = [
   {
     label: '应用',
     field: 'appId',
-    required: true,
-    component: 'JDictSelectTag',
+    component: 'ApiSelect',
     componentProps: {
-      dictCode: 'app_base_info,name,id',
-      placeholder: '请选择应用',
-      onChange: (value) => {
-        onCleanCode();
-      },
+      api: appList,
+      labelField: 'name',
+      valueField: 'id',
+      placeholder: '请选择应用'
     },
-
   },
-
-  {
+   {
     field: 'roleName',
     label: '角色名称',
     required: true,

+ 14 - 0
jeecgboot-vue3/src/views/system/user/UserRecycleBinModal.vue

@@ -87,6 +87,7 @@
    * 还原事件
    */
   async function handleRevert(record) {
+    await clearCheckedKeys(record.id)
     await putRecycleBin({ userIds: record.id }, reload);
     emit('success');
   }
@@ -100,8 +101,21 @@
    * 删除事件
    */
   async function handleDelete(record) {
+    await clearCheckedKeys(record.id)
     await deleteRecycleBin({ userIds: record.id }, reload);
   }
+
+  //清除复选框勾选
+  function clearCheckedKeys(id) {
+    if (id.toString().includes(',')) {
+      checkedKeys.value = []
+    } else {
+      let index = checkedKeys.value.indexOf(id);
+      if (index !== -1) {
+        checkedKeys.value.splice(index, 1);
+      }
+    }
+  }
   /**
    * 批量删除事件
    */

+ 14 - 3
jeecgboot-vue3/src/views/system/user/index.vue

@@ -5,7 +5,7 @@
         <a-card :bordered="false" style="height: 100%">
           <a-spin :spinning="loading">
             <a-input-search placeholder="按部门名称搜索…" style="margin-bottom: 10px"
-                            @search="onSearch"/>
+                            @search="onSearch" v-model:value="searchValue" />
             <!--组织机构树-->
             <template v-if="treeData.length > 0">
               <a-tree
@@ -27,7 +27,7 @@
         </a-card>
       </div>
       <div style="display: flex; flex-direction: column; width: 1350px;">
-        <div style="flex: 1; padding-top: 10px;padding-left: 10px; padding-right: 10px;">
+        <div style="padding-top: 10px;padding-left: 10px; padding-right: 10px;">
           <a-card :bordered="false" :bodyStyle = cardBodyStyle>
             <LTTCBaseServiceAdvancedSearch
               :fieldOptions="dataFields"
@@ -97,7 +97,7 @@
 
 <script lang="ts" name="system-user" setup>
   //ts语法
-  import {ref, computed, unref, nextTick} from 'vue';
+  import {ref, computed, unref, nextTick, watch} from 'vue';
   import { BasicTable, TableAction, ActionItem } from '/@/components/Table';
   import UserDrawer from './UserDrawer.vue';
   import UserRecycleBinModal from './UserRecycleBinModal.vue';
@@ -159,6 +159,8 @@
   const rawData = ref<any[]>([]);
   // 高级查询参数
   const queries = ref([]);
+  //搜索值
+  const searchValue = ref('');
 
   //高级查询参数
   const dataFields = [
@@ -422,6 +424,10 @@
       return;
     }
     await deleteUser({ id: record.id }, reload);
+    let number = selectedRowKeys.value.indexOf(record.id);
+    if (number !== -1) {
+      selectedRowKeys.value.splice(number, 1);
+    }
   }
   /**
    * 批量删除事件
@@ -600,6 +606,11 @@
     padding: '0px',
   };
 
+  //监听搜索框内值的变化
+  watch(searchValue, (newVal) => {
+    onSearch(newVal);
+  });
+
 
 </script>
 

+ 2 - 0
jeecgboot-vue3/src/views/system/user/user.data.ts

@@ -291,6 +291,8 @@ export const formSchema: FormSchema[] = [
       dictCode: 'sex',
       placeholder: '请选择性别',
       stringToNumber: true,
+      allowClear: false,
+      showChooseOption: false,
     },
   },
   {