From ee34615f5569dc1792c062348f366c8ca5b10e7d Mon Sep 17 00:00:00 2001 From: Akkia Date: Fri, 14 Oct 2022 01:31:00 +0800 Subject: [PATCH] fix: Gitee login error --- cmd/dashboard/controller/oauth2.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/dashboard/controller/oauth2.go b/cmd/dashboard/controller/oauth2.go index 1121380..4b11815 100644 --- a/cmd/dashboard/controller/oauth2.go +++ b/cmd/dashboard/controller/oauth2.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "net/http" + "net/url" "strings" "code.gitea.io/sdk/gitea" @@ -149,7 +150,11 @@ func (oa *oauth2controller) callback(c *gin.Context) { var client *GitHubAPI.Client oc := oauth2Config.Client(ctx, otk) if singleton.Conf.Oauth2.Type == model.ConfigTypeGitee { - client, err = GitHubAPI.NewEnterpriseClient("https://gitee.com/api/v5/", "https://gitee.com/api/v5/", oc) + baseURL, _ := url.Parse("https://gitee.com/api/v5/") + uploadURL, _ := url.Parse("https://gitee.com/api/v5/uploads/") + client = GitHubAPI.NewClient(oc) + client.BaseURL = baseURL + client.UploadURL = uploadURL } else { client = GitHubAPI.NewClient(oc) }