mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-23 05:08:13 -05:00
commit
7d8fe82aa2
@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
@ -149,7 +150,11 @@ func (oa *oauth2controller) callback(c *gin.Context) {
|
|||||||
var client *GitHubAPI.Client
|
var client *GitHubAPI.Client
|
||||||
oc := oauth2Config.Client(ctx, otk)
|
oc := oauth2Config.Client(ctx, otk)
|
||||||
if singleton.Conf.Oauth2.Type == model.ConfigTypeGitee {
|
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 {
|
} else {
|
||||||
client = GitHubAPI.NewClient(oc)
|
client = GitHubAPI.NewClient(oc)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user