feat: 支持修改用户名

This commit is contained in:
naiba committed 2024-11-30 15:05:46 +08:00
1 parent 38d898c078
commit bbcfd6a83b
3 files changed
+3 -1

No files matched your search

+1
View File
@@ -62,6 +62,7 @@ func updateProfile(c *gin.Context) (any, error) {
return nil, err
}
user.Username = pf.NewUsername
user.Password = string(hash)
if err := singleton.DB.Save(&user).Error; err != nil {
return nil, newGormError("%v", err)