fix
This commit is contained in:
parent
2aacbf1c3e
commit
d3c96184b8
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/fssql"
|
||||
|
@ -174,7 +173,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
|
||||
log.Println("success", token.TraceId)
|
||||
logx.Info("success", token.TraceId)
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
|
||||
FirstName := token.Extend["first_name"].(string)
|
||||
|
@ -195,11 +194,11 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
|||
return err
|
||||
}
|
||||
|
||||
log.Println("success", token.TraceId)
|
||||
logx.Info("success", token.TraceId)
|
||||
|
||||
// 继承guest_id的资源表
|
||||
err = InheritGuestIdResource(tx, user.Id, token.GuestId, func(txResouce, txUserMaterial, txUserInfo *gorm.DB) error {
|
||||
log.Println("success", token.TraceId)
|
||||
logx.Info("success", token.TraceId)
|
||||
userProfile := &UserProfile{
|
||||
FirstName: FirstName,
|
||||
LastName: LastName,
|
||||
|
@ -224,8 +223,9 @@ 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
|
||||
log.Println(err, "找到user_id1")
|
||||
|
||||
if err != nil {
|
||||
logx.Info(err)
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
err = txUserInfo.Create(uinfo).Error
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
|
@ -233,7 +233,7 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
|||
}
|
||||
}
|
||||
} else {
|
||||
log.Println("找到user_id2")
|
||||
logx.Info("找到user_id2")
|
||||
err = fssql.MetadataModulePATCH(txUserInfo, "profile", FsUserInfo{}, metadata, "user_id = ?", *uinfo.UserId)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -97,7 +97,7 @@ func CommonNotify(WebsocketAddr, wid string, event *wevent.WebsocketEvent) error
|
|||
func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEmailConfirmation, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||
// userinfo 传入值时, 一定不为null
|
||||
logx.Error("找到user_id1 UserEmailConfirmation")
|
||||
|
||||
switch auth.OperateType(req.OpType) {
|
||||
case auth.OpTypeRegister:
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user