Commit 727e62c0 authored by chenqikuai's avatar chenqikuai

feat: 版本号只能输入数字

parent 107aaf1c
......@@ -132,16 +132,19 @@ export const versionCodeFieldConfig = {
{ required: true, message: '请输入版本号' },
{
validator(rule: string, value: string, callback: Function) {
const osType = store.state.VersionControl?.form.osType
if (osType === eOsType.ios) {
value.match(/^\d+\.\d+\.\d+$/)
value.match(/^\d+$/)
? callback()
: callback(new Error('苹果请输入x.x.x格式的版本号'))
} else if (osType === eOsType.android) {
value.match(/^\d+$/)
? callback()
: callback(new Error('安卓请输入数字格式的版本号'))
}
: callback(new Error('请输入数字格式的版本号'))
// const osType = store.state.VersionControl?.form.osType
// if (osType === eOsType.ios) {
// value.match(/^\d+\.\d+\.\d+$/)
// ? callback()
// : callback(new Error('苹果请输入x.x.x格式的版本号'))
// } else if (osType === eOsType.android) {
// value.match(/^\d+$/)
// ? callback()
// : callback(new Error('安卓请输入数字格式的版本号'))
// }
},
},
],
......
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