Skip to content

Commit

Permalink
fix: 修改合法账号名模式
Browse files Browse the repository at this point in the history
  • Loading branch information
link89 committed Nov 1, 2024
1 parent b88882d commit 2352e26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ func GetUserNameByUid(uid int) (string, error) {

// 判断字符串是否为合法用户名或账号名
func CheckAccountOrUserStrings(s string) bool {
// 允许字母、数字、下划线、连字符
pattern := "^[a-zA-Z0-9_-]+$"
// 允许小写字母、数字、下划线、连字符
pattern := "^[a-z0-9_-]+$"
// 编译正则表达式
reg := regexp.MustCompile(pattern)
// 使用正则表达式判断字符串是否符合模式
Expand Down

0 comments on commit 2352e26

Please sign in to comment.