Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming
2023-09-06 12:22:06 +08:00
3 changed files with 11 additions and 5 deletions

View File

@@ -111,7 +111,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
return resp.SetStatusWithMessage(basic.CodeOAuthConfirmationTimeoutErr, "Verification links expire after 30 minute.")
}
logx.Info(token.Platform)
logx.Error(token.Platform)
switch token.Platform {
case string(auth.PLATFORM_GOOGLE):
// 谷歌平台的注册流程

View File

@@ -7,7 +7,6 @@ import (
"fusenapi/utils/auth"
"fusenapi/utils/basic"
"io"
"log"
"net/http"
"time"
@@ -73,9 +72,10 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
return resp.SetStatus(basic.CodeOAuthGoogleApiErr, err.Error())
}
log.Println(r.Json())
gresult := r.Json()
logx.Info(gresult)
googleId := r.Json().Get("id").Int()
googleId := gresult.Get("id").Int()
user, err := l.svcCtx.AllModels.FsUser.FindUserByGoogleId(context.TODO(), googleId)
if err != nil {
if err != gorm.ErrRecordNotFound {
@@ -96,7 +96,9 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
TraceId: uuid.NewString(),
CreateAt: time.Now().UTC(),
Extend: map[string]interface{}{
"google_id": googleId,
"google_id": googleId,
"first_name": gresult.Get("family_name").String(),
"last_name": gresult.Get("given_name").String(),
},
}