Skip to content

Commit

Permalink
Update validateForm.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-advokate authored Sep 11, 2024
1 parent 338acc7 commit 18340ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plugins/validate/validateForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export default {
if (!value) {
callback("字段不能为空");
} else {
if (Reg.userName.test(value)) {
if (rule && rule.test(value)) {
callback();
} else if (Reg.userName.test(value)) {
callback();
} else {
callback("格式错误");
Expand All @@ -16,7 +18,9 @@ export default {
if (!value) {
callback("字段不能为空");
} else {
if (Reg.password.test(value)) {
if (rule && rule.test(value)) {
callback();
} else if (Reg.password.test(value)) {
callback();
} else {
callback("格式错误");
Expand Down

0 comments on commit 18340ca

Please sign in to comment.