fix: 精简应用发布时commit消息的校验规则 (#205)

This commit is contained in:
Gene 2023-12-29 09:09:38 +08:00 committed by GitHub
parent f8390c0c89
commit ec95df7c7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -272,12 +272,7 @@ const confirm = () => {
}
})
}
const validatePass = (rule, value, callback) => {
if (!/((IR|RR|BUG|US|WI|Hawk|DTS|FE|TG|NA|EP)[0-9]{13}.*)|(#[0-9a-zA-Z]*)/.test(value)) {
callback(new Error('输入的commit msg不合法请填写正确的单号'))
}
callback()
}
const handleClick = ({ code }) => {
actions[code]?.()
}
@ -285,10 +280,7 @@ const handleClick = ({ code }) => {
const rules = {
account: [{ required: true, message: '必填', trigger: 'change' }],
password: [{ required: true, message: '必填', trigger: 'change' }],
commitMsg: [
{ required: true, message: '必填', trigger: 'change' },
{ validator: validatePass, trigger: 'blur' }
],
commitMsg: [{ required: true, message: '必填', trigger: 'change' }],
branch: [{ required: true, message: '必填', trigger: 'change' }]
}