From 46de2a899b0e8defa1a3457ebc59b291741873c1 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Mon, 28 Apr 2025 13:42:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0gitee,=E4=BF=AE=E6=94=B9url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proto/tool.go | 14 ++++++++------ service/toolService.go | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/proto/tool.go b/proto/tool.go index f5ef7a6..17755b4 100644 --- a/proto/tool.go +++ b/proto/tool.go @@ -91,12 +91,14 @@ type GitHubOAuthResponse struct { } type GiteeOAuthTokenResponse struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - ExpiresIn int `json:"expires_in"` - RefreshToken string `json:"refresh_token"` - Scope string `json:"scope"` - CreatedAt int `json:"created_at"` + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + ExpiresIn int `json:"expires_in"` + RefreshToken string `json:"refresh_token"` + Scope string `json:"scope"` + CreatedAt int `json:"created_at"` + Error string `json:"error"` + ErrorDescription string `json:"error_description"` } type OAuthGetTokenRequest struct { diff --git a/service/toolService.go b/service/toolService.go index 7551e53..8c623f4 100644 --- a/service/toolService.go +++ b/service/toolService.go @@ -275,13 +275,14 @@ func GenerateJWTToken(userID int, userName string) (string, error) { func DoGiteeCallBack(state *proto.ThirdPartyLoginState, code string) { //获取Access Token - resp, err := worker.GetGiteeAccessTokenByCode(code, "https://pm.ljsea.top/gitee_callback", proto.Config.GITEE_CLIENT_ID, proto.Config.GITEE_CLIENT_SECRET) + resp, err := worker.GetGiteeAccessTokenByCode(code, "https://pm.ljsea.top/tool/gitee_callback", proto.Config.GITEE_CLIENT_ID, proto.Config.GITEE_CLIENT_SECRET) if err != nil { log.Println("get gitee access token error:", err) return } if resp.AccessToken == "" { log.Println("get gitee access token is empty") + log.Println("get gitee access token error:", resp) return } log.Println("get gitee access token:", resp.AccessToken)