Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
5d32139e09
|
@ -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) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
|
||||
"github.com/474420502/requests"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type UserEmailConfirmationLogic struct {
|
||||
|
@ -117,7 +118,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
|||
case "fusen":
|
||||
// log.Println("aaaa", token)
|
||||
user, err := l.svcCtx.AllModels.FsUser.RegisterByFusen(l.ctx, token)
|
||||
if err != nil {
|
||||
if err != nil && err != gorm.ErrRecordNotFound {
|
||||
logx.Error(err, ":", token.TraceId)
|
||||
return resp.SetStatus(basic.CodeDbSqlErr)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user