cmc-web/webs/cmp-web/src/validate/software.js

15 lines
424 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

const trigger = null
export default {
datebasePassword: {
validator: (rule, value, callback) => {
const reg = /(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*()+_-]).{8,32}/
if (!value || reg.test(value)) {
callback()
} else {
callback(new Error('请输入8-32位必须同时包含大小写字母、数字、特殊字符[!@#$%^&*()+_-]'))
}
},
trigger: trigger
}
}