nacos config
This commit is contained in:
parent
822a2163a0
commit
edb1b0c0f2
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/fssql"
|
||||
|
@ -173,7 +174,7 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
|||
var err error
|
||||
|
||||
err = tx.Model(&FsUser{}).Where("email = ?", token.Email).Take(user).Error
|
||||
logx.Info("success", token.TraceId)
|
||||
log.Println("success", token.TraceId)
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
|
||||
FirstName := token.Extend["first_name"].(string)
|
||||
|
@ -194,11 +195,11 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
|||
return err
|
||||
}
|
||||
|
||||
logx.Info("success", token.TraceId)
|
||||
log.Println("success", token.TraceId)
|
||||
|
||||
// 继承guest_id的资源表
|
||||
err = InheritGuestIdResource(tx, user.Id, token.GuestId, func(txResouce, txUserMaterial, txUserInfo *gorm.DB) error {
|
||||
logx.Info("success", token.TraceId)
|
||||
log.Println("success", token.TraceId)
|
||||
userProfile := &UserProfile{
|
||||
FirstName: FirstName,
|
||||
LastName: LastName,
|
||||
|
@ -223,7 +224,7 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
|||
|
||||
err = txUserInfo.Where("module = 'profile' and user_id = ?", uinfo.UserId).Take(nil).Error
|
||||
// txUserInfo.Statement.Table
|
||||
logx.Info(err, "找到user_id1")
|
||||
log.Println(err, "找到user_id1")
|
||||
if err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
err = txUserInfo.Create(uinfo).Error
|
||||
|
@ -232,7 +233,7 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
|||
}
|
||||
}
|
||||
} else {
|
||||
logx.Info("找到user_id2")
|
||||
log.Println("找到user_id2")
|
||||
err = fssql.MetadataModulePATCH(txUserInfo, "profile", FsUserInfo{}, metadata, "user_id = ?", *uinfo.UserId)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue
Block a user