fix
This commit is contained in:
parent
7a845bb83f
commit
1ed2346303
|
@ -141,8 +141,9 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
|||
|
||||
user = &FsUser{}
|
||||
var err error
|
||||
UserTx := tx.Model(user)
|
||||
err = UserTx.Where("email = ?", token.Email).Take(user).Error
|
||||
|
||||
userTx := tx.Model(user)
|
||||
err = userTx.Where("email = ?", token.Email).Take(user).Error
|
||||
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
|
||||
|
@ -151,13 +152,14 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
|||
Resetaurant := token.Extend["resetaurant"].(string)
|
||||
|
||||
createAt := time.Now().UTC().Unix()
|
||||
|
||||
user.Email = &token.Email
|
||||
user.CreatedAt = &createAt
|
||||
user.PasswordHash = &token.Password
|
||||
user.FirstName = &FirstName
|
||||
user.LastName = &LastName
|
||||
|
||||
err = UserTx.Create(user).Error
|
||||
err = tx.Model(user).Create(user).Error
|
||||
if err != nil && err != gorm.ErrRecordNotFound {
|
||||
logx.Error(err)
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue
Block a user