ludu-cloud/admin-web/helpers/validator.js

10 lines
223 B
Java
Raw Normal View History

// 校验必须是英文或者数字
export function checkTypeWithEnglishAndNumbers (rule, value, callback, text) {
let char = /^[a-zA-Z0-9]+$/
if (char.test(value)) {
callback()
} else {
callback(text)
}
}