🔖 chore: prohibit users from modifying usernames

This commit is contained in:
MartialBE
2024-05-15 12:35:04 +08:00
parent 59d3b13311
commit 5ae57435ba
3 changed files with 5 additions and 7 deletions

View File

@@ -139,9 +139,6 @@ func (user *User) Insert(inviterId int) error {
}
func (user *User) Update(updatePassword bool) error {
if RecordExists(&User{}, "username", user.Username, user.Id) {
return errors.New("用户名已存在!")
}
var err error
if updatePassword {
user.Password, err = common.Password2Hash(user.Password)