diff --git a/server/auth/internal/logic/usergoogleloginlogic.go b/server/auth/internal/logic/usergoogleloginlogic.go index 96879180..c4130d20 100644 --- a/server/auth/internal/logic/usergoogleloginlogic.go +++ b/server/auth/internal/logic/usergoogleloginlogic.go @@ -54,7 +54,7 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us // userinfo 传入值时, 一定不为null var googleOauthConfig = &oauth2.Config{ - RedirectURL: fmt.Sprintf("http://%s/api/user/oauth2/login/google", l.svcCtx.Config.MainAddress), + RedirectURL: fmt.Sprintf("https://%s/api/auth/oauth2/login/google", l.svcCtx.Config.MainAddress), ClientID: l.svcCtx.Config.OAuth.Google.Appid, ClientSecret: l.svcCtx.Config.OAuth.Google.Secret, Scopes: []string{"https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"}, @@ -67,8 +67,7 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us resp.SetStatus(basic.CodeApiErr) } - ses := requests.NewSession() - r, err := ses.Get("https://www.googleapis.com/oauth2/v2/userinfo?access_token=" + token.AccessToken).Execute() + 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)