Browse Source

fix: 验证某个字段的值是否已经存在 表达式错误

冷冷 9 months ago
parent
commit
f47a3f9078
1 changed files with 1 additions and 1 deletions
  1. 1 1
      common/api.ts

+ 1 - 1
common/api.ts

@@ -89,7 +89,7 @@ export function validateExist(rule: any, value: any, callback: any, isEdit: bool
 
   getObj({ [rule.field]: value }).then((response) => {
     const result = response.data;
-    if (result !== null) {
+    if (result !== null && result.length > 0) {
       callback(new Error('数据已经存在'));
     } else {
       callback();