From 3ab7ed28d42b9b1ef71766abeea0df8d0b5b1122 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Wed, 30 Aug 2023 10:45:48 +0800 Subject: [PATCH] fix --- server/auth/internal/logic/usergoogleloginlogic.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/auth/internal/logic/usergoogleloginlogic.go b/server/auth/internal/logic/usergoogleloginlogic.go index c4130d20..609e08a6 100644 --- a/server/auth/internal/logic/usergoogleloginlogic.go +++ b/server/auth/internal/logic/usergoogleloginlogic.go @@ -64,13 +64,13 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us token, err := googleOauthConfig.Exchange(l.ctx, req.Code) if err != nil { logx.Error(err) - resp.SetStatus(basic.CodeApiErr) + return resp.SetStatus(basic.CodeApiErr, err.Error()) } r, err := requests.Get("https://www.googleapis.com/oauth2/v2/userinfo?access_token=" + token.AccessToken).Execute() if err != nil { logx.Error(err) - return resp.SetStatus(basic.CodeOAuthGoogleApiErr) + return resp.SetStatus(basic.CodeOAuthGoogleApiErr, err.Error()) } log.Println(r.Json())