添加管理员时默认添加登录用户。登录允许手机号登录

This commit is contained in:
ZLI263
2025-10-27 10:32:26 +08:00
parent 8695d81e16
commit 1b3df8f5a4
9 changed files with 1265 additions and 12 deletions

View File

@@ -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())
}