Skip to content

Commit

Permalink
fix: 验证某个字段的值是否已经存在 表达式错误
Browse files Browse the repository at this point in the history
  • Loading branch information
lltx authored Jul 14, 2024
1 parent a00aef4 commit f47a3f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f47a3f9

Please sign in to comment.