diff --git a/model/gmodel/fs_user_logic.go b/model/gmodel/fs_user_logic.go index 26feef96..ae9e50d7 100644 --- a/model/gmodel/fs_user_logic.go +++ b/model/gmodel/fs_user_logic.go @@ -135,11 +135,7 @@ type UserProfile struct { } // 自平台的注册流程 -func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterToken) (*FsUser, error) { - - var err error - - user := &FsUser{} +func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterToken) (user *FsUser, err error) { logcontent := "" defer func() { @@ -148,6 +144,8 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT err = u.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error { + user = &FsUser{} + var err error UserTx := tx.Model(user) err = UserTx.Where("email = ?", token.Email).Take(user).Error @@ -217,7 +215,7 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT return nil, err } - return user, nil + return } func (u *FsUserModel) UpdateUserBasicInfoById(ctx context.Context, Id int64, user *UserBasicInfoForSave) (err error) {