fix
This commit is contained in:
parent
b3fcf0c77c
commit
d9de812728
|
@ -46,7 +46,7 @@ func (u *FsUserModel) FindUserByGoogleId(ctx context.Context, Id int64) (resp Fs
|
|||
}
|
||||
|
||||
func (u *FsUserModel) Transaction(ctx context.Context, fc func(tx *gorm.DB) error) (err error) {
|
||||
return u.db.WithContext(ctx).Transaction(fc)
|
||||
return u.db.Model(&FsUser{}).WithContext(ctx).Transaction(fc)
|
||||
}
|
||||
|
||||
// 继承guest_id的资源表
|
||||
|
|
|
@ -56,8 +56,9 @@ func (l *UserResetPasswordLogic) UserResetPassword(req *types.RequestUserResetPa
|
|||
|
||||
err = l.svcCtx.AllModels.FsUser.Transaction(l.ctx, func(tx *gorm.DB) error {
|
||||
user := &gmodel.FsUser{Id: int64(rt.UserId)}
|
||||
err := tx.Model(user).Take(user).Error
|
||||
err := tx.Take(user).Error
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return err
|
||||
}
|
||||
if *user.PasswordHash != rt.OldPassword {
|
||||
|
|
Loading…
Reference in New Issue
Block a user