Commit b38709a3 authored by honghy's avatar honghy Committed by wux

【后台-会员等级】新增/修改页面中,“等级有效期”、“积分累计周期”要限制只能输入正整数

parent 0e2d47a7
...@@ -291,10 +291,13 @@ export default { ...@@ -291,10 +291,13 @@ export default {
validatePositiveIntegerorNull(rule, value, callback) { validatePositiveIntegerorNull(rule, value, callback) {
if (value === '') { if (value === '') {
callback(); callback();
} else if (!/^\d+$/.test(value)) {
callback(new Error(this.$t("请输入整数")));
} else { } else {
callback(); const regex = /^[1-9]\d*$/;
if (regex.test(value)) {
callback();
} else {
callback(new Error(this.$t("请输入整数")));
}
} }
}, },
handleMemberLevelDetails(){ handleMemberLevelDetails(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment