添加管理员时默认添加登录用户。登录允许手机号登录
This commit is contained in:
@@ -16,5 +16,11 @@ export function isExternal(path) {
|
||||
*/
|
||||
export function validUsername(str) {
|
||||
const valid_map = ['admin', 'editor']
|
||||
return valid_map.indexOf(str.trim()) >= 0
|
||||
// 支持原有的用户名
|
||||
if (valid_map.indexOf(str.trim()) >= 0) {
|
||||
return true
|
||||
}
|
||||
// 支持手机号格式(11位数字,以1开头)
|
||||
const phoneRegex = /^1[3-9]\d{9}$/
|
||||
return phoneRegex.test(str.trim())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user