Commit c7565ff2 authored by chenqikuai's avatar chenqikuai

fix

parent f73c667b
......@@ -128,7 +128,23 @@ export const versionCodeFieldConfig = {
required: true,
variableName: 'versionCode',
fieldType: eFieldType.Input,
rules: [{ required: true, message: '请输入版本号' }],
rules: [
{ 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+$/)
? callback()
: callback(new Error('ios请输入x.x.x格式的版本号'))
} else if (osType === eOsType.android) {
value.match(/^\d+$/)
? callback()
: callback(new Error('安卓请输入数字格式的版本号'))
}
},
},
],
fieldProps: {
maxLength: 10,
},
......
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