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) {
|
func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterToken) (user *FsUser, err error) {
|
||||||
|
|
||||||
var err error
|
|
||||||
|
|
||||||
user := &FsUser{}
|
|
||||||
|
|
||||||
logcontent := ""
|
logcontent := ""
|
||||||
defer func() {
|
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 {
|
err = u.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||||
|
|
||||||
|
user = &FsUser{}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
UserTx := tx.Model(user)
|
UserTx := tx.Model(user)
|
||||||
err = UserTx.Where("email = ?", token.Email).Take(user).Error
|
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 nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return user, nil
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *FsUserModel) UpdateUserBasicInfoById(ctx context.Context, Id int64, user *UserBasicInfoForSave) (err error) {
|
func (u *FsUserModel) UpdateUserBasicInfoById(ctx context.Context, Id int64, user *UserBasicInfoForSave) (err error) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
|
|
||||||
"github.com/474420502/requests"
|
"github.com/474420502/requests"
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserEmailConfirmationLogic struct {
|
type UserEmailConfirmationLogic struct {
|
||||||
|
@ -117,7 +118,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
||||||
case "fusen":
|
case "fusen":
|
||||||
// log.Println("aaaa", token)
|
// log.Println("aaaa", token)
|
||||||
user, err := l.svcCtx.AllModels.FsUser.RegisterByFusen(l.ctx, 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)
|
logx.Error(err, ":", token.TraceId)
|
||||||
return resp.SetStatus(basic.CodeDbSqlErr)
|
return resp.SetStatus(basic.CodeDbSqlErr)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user