Source/UBCS-WEB/src/page/login/userlogin.vue
@@ -40,7 +40,6 @@ </el-form-item> <el-form-item> <el-button @click="ChandleLogin">测试单点登录</el-button> <el-button class="login-submit" size="small" type="primary" Source/UBCS-WEB/src/views/system/user.vue
@@ -373,7 +373,7 @@ trigger: "click" }], span: 24, value:"211833" value:"" }, { label: "登录账号", @@ -1034,33 +1034,33 @@ }) }, beforeOpen(done, type) { // console.log(type) //console.log(type) // console.log('this.tenantId',this.tenantId) // const column = this.findObject(this.option.group,'tenantId'); // column.value=this.tenantId; // console.log('column',column) if(this.treeDeptId){ if (["edit", "view"].includes(type)) { getUser(this.form.id).then(res => { this.form = res.data.data; if (this.form.hasOwnProperty("deptId")) { this.form.deptId = this.form.deptId.split(","); } if (this.form.hasOwnProperty("roleId")) { this.form.roleId = this.form.roleId.split(","); } if (this.form.hasOwnProperty("postId")) { this.form.postId = this.form.postId.split(","); } }); } const prop = this.findObject(this.option.group, 'tenantId'); console.log('1',prop) this.initFlag = true; done(); }else { this.$message.warning('请选择一条所属租户') // if(this.treeDeptId){ if (["edit", "view"].includes(type)) { getUser(this.form.id).then(res => { this.form = res.data.data; if (this.form.hasOwnProperty("deptId")) { this.form.deptId = this.form.deptId.split(","); } if (this.form.hasOwnProperty("roleId")) { this.form.roleId = this.form.roleId.split(","); } if (this.form.hasOwnProperty("postId")) { this.form.postId = this.form.postId.split(","); } }); } const prop = this.findObject(this.option.group, 'tenantId'); //console.log('1',prop) this.initFlag = true; done(); // }else { // this.$message.warning('请选择一条所属租户') // } }, currentChange(currentPage) { this.page.currentPage = currentPage; Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java
@@ -196,8 +196,11 @@ } } if (Func.isEmpty(role.getParentId())) { role.setTenantId(AuthUtil.getTenantId()); role.setParentId(BladeConstant.TOP_PARENT_ID); // 前端传了是属于那个租户id下的角色 if(Func.isEmpty(role.getTenantId())){ role.setTenantId(AuthUtil.getTenantId()); } } if (role.getParentId() > 0) { Role parent = getById(role.getParentId()); Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/TenantServiceImpl.java
@@ -212,7 +212,7 @@ @Override public List<Map<String,Object>> selectMaps(){ List<Map<String, Object>> mapList = listMaps(new QueryWrapper<Tenant>().select("TENANT_ID", "TENANT_NAME")); if(Func.isNotEmpty(nacosConfigCache.getAdminUserInfo().getTenantId())){ if(Func.isNotEmpty(nacosConfigCache.getAdminUserInfo().getTenantId()) && !this.containsSameKeys(mapList,nacosConfigCache.getAdminUserInfo().getTenantId())){ Map<String, Object> map = new HashMap<>(); map.put("TENANT_ID",nacosConfigCache.getAdminUserInfo().getTenantId()); map.put("TENANT_NAME","管理组"); @@ -222,6 +222,22 @@ } /** * 判断数据库中是否存在于配置文件中一致的超管信息 * @param collection * @param value * @return */ private boolean containsSameKeys(List<Map<String, Object>> collection, String value) { for (Map<String, Object> map : collection) { Collection<Object> values = map.values(); if (values.contains(value)) { return true; } } return false; } /** * 三员相关配置 * @return */