From b6386e988df3743fdf0468cab082ba7621877692 Mon Sep 17 00:00:00 2001 From: suyanyan <1321717064@qq.com> Date: Tue, 8 Oct 2024 11:40:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=85=E9=81=93bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/userManage/keyPersonnel/components/form/index.vue | 3 +-- .../src/views/userManage/personnel/components/form/index.vue | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue index 1c9cb8f..f328e6f 100644 --- a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue +++ b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue @@ -43,8 +43,7 @@ const sysUserProps = reactive>({ disabled: false }); const checkAgeNumber = (rule: any, value: any, callback: any) => { - if (value === "") callback("请输入年龄"); - if (value > 100 || value < 0) { + if (value && (value > 100 || value <= 0)) { callback(new Error("请输入正确的年龄(年龄范围1-100岁)")); } else { return callback(); diff --git a/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue b/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue index 8271add..7fbd31e 100644 --- a/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue +++ b/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue @@ -44,8 +44,7 @@ const sysUserProps = reactive>({ disabled: false }); const checkAgeNumber = (rule: any, value: any, callback: any) => { - if (value === "") callback("请输入年龄"); - if (value > 100 || value < 0) { + if (value && (value > 100 || value <= 0)) { callback(new Error("请输入正确的年龄(年龄范围1-100岁)")); } else { return callback();