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();