Pārlūkot izejas kodu

修复:角色管理-编辑角色修改除应用和编码之外的值,保存时报错:校验编码唯一

ZL 2 nedēļas atpakaļ
vecāks
revīzija
1e102bb701
1 mainītis faili ar 3 papildinājumiem un 7 dzēšanām
  1. 3 7
      jeecgboot-vue3/src/views/system/role/role.data.ts

+ 3 - 7
jeecgboot-vue3/src/views/system/role/role.data.ts

@@ -168,8 +168,6 @@ export const formSchema: FormSchema[] = [
       return !values.appId;
     },
     dynamicRules: ({ values, model }) => {
-      console.log('values:', values);
-
       return [
         {
           required: true,
@@ -179,12 +177,10 @@ export const formSchema: FormSchema[] = [
             }
 
             if (values) {
-              // console.log('values:', values.appId);
-              // if (!values.appId) {
-              //   return Promise.reject('请先选择应用');
-              // }
+              
               return new Promise((resolve, reject) => {
-                isRoleExist({ id: model.id, roleCode: value, appId: model.appId })
+                const appId = Array.isArray(model.appId) ? model.appId[0] : model.appId;
+                isRoleExist({ id: model.id, roleCode: value, appId:appId })
                   .then((res) => {
                     res.success ? resolve() : reject(res.message || '校验失败');
                   })