# 更改登录用户名验证规则

This commit is contained in:
xianfuxing 2018-07-24 19:28:11 +08:00
parent 5f0a451a7a
commit ce52118621
1 changed files with 4 additions and 2 deletions

View File

@ -3,8 +3,10 @@
*/
export function isvalidUsername(str) {
const valid_map = ['xianfuxing', 'editor']
return valid_map.indexOf(str.trim()) >= 0
// const valid_map = ['xianfuxing', 'editor']
// return valid_map.indexOf(str.trim()) >= 0
const usernameRegex = /^(?![0-9]+$)[0-9A-Za-z]{4,}$/
return usernameRegex.test(str)
}
/* 合法uri*/