From d6a15176892a78dee57cb8475ef88b0106d30488 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Wed, 30 Apr 2025 16:16:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0google=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=99=BB=E5=BD=95,=E4=BF=AE=E6=94=B9=E4=B8=AD?= =?UTF-8?q?=E7=BB=A7=E8=AF=B7=E6=B1=82post=E6=A8=A1=E5=BC=8F=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/tool.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/handler/tool.go b/handler/tool.go index 8e5cb41..47604a2 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -810,11 +810,14 @@ func GetThirdPartyAuthUrl(c *gin.Context) { params := url.Values{} params.Add("client_id", worker.GoogleClientID) params.Add("response_type", "code") //直接返回token - params.Add("redirect_uri", "https://pm.ljsea.top/tool/third_party_callback") - params.Add("scope", "https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile") + redirectURL := "https://pm.ljsea.top/tool/third_party_callback" + scope := "https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile" + //params.Add("redirect_uri", "https://pm.ljsea.top/tool/third_party_callback") + //params.Add("scope", "https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile") params.Add("state", stateBase64Str) baseUri := proto.GoogleAuthorizeBaseUrl respUrl = fmt.Sprintf("%s?%s", baseUri, params.Encode()) + respUrl = fmt.Sprintf("%s&redirect_uri=%s&scope=%s", respUrl, redirectURL, scope) } resp.Message = "success" resp.Code = proto.SuccessCode