hurx 2 days ago
parent
commit
8a405803b1
2 changed files with 6 additions and 1 deletions
  1. 0 1
      src/views/system/role/index.vue
  2. 6 0
      src/views/system/user/index.vue

+ 0 - 1
src/views/system/role/index.vue

@@ -390,7 +390,6 @@ const handleAdd = () => {
 };
 /** 修改角色 */
 const handleUpdate = async (row?: RoleVO) => {
-  console.log(row);
   reset();
   const roleId = row?.roleId || ids.value[0];
   const { data } = await getRole(roleId);

+ 6 - 0
src/views/system/user/index.vue

@@ -633,9 +633,15 @@ const handleUpdate = async (row?: UserForm) => {
   const { data } = await api.getUser(userId);
   dialog.visible = true;
   dialog.title = '修改用户';
+
+  // 使用角色数据中的平台代码
+  if (row.platformCode) {
+    form.value.platformCode = row.platformCode;
+  }
   Object.assign(form.value, data.user);
   postOptions.value = data.posts;
   roleOptions.value = Array.from(new Map([...data.roles, ...data.user.roles].map((role) => [role.roleId, role])).values());
+
   form.value.postIds = data.postIds;
   form.value.roleIds = data.roleIds;
   form.value.password = '';