fix: 修复初始化用户后,登录失败后报密码错误

Removed user existence check and password update logic.
This commit is contained in:
FamousMai
2025-10-19 16:44:58 +08:00
committed by GitHub
parent f814fb39f1
commit 2186654be7
-6
View File
@@ -128,12 +128,6 @@ func RegisterUser(u system.SysUser, token string) (err error) {
global.GVA_LOG.Debug("注册用户信息:", zap.Any("1", 1))
var acc gaia.Account
if err = global.GVA_DB.Where("email=?", u.Email).First(&acc).Error; err == nil {
// 用户已存在,更新密码
global.GVA_LOG.Info(fmt.Sprintf("account %s already exists, updating password", acc.Name))
global.GVA_DB.Model(&acc).Updates(&map[string]interface{}{
"password": passwordHashed,
"password_salt": salt,
})
return nil
}
// 默认以root执行