第三方登录添加gitee,修改url
This commit is contained in:
parent
c6da195d27
commit
39adf3f1bd
|
|
@ -113,6 +113,12 @@ type GitHubOAuthRequest struct {
|
|||
RedirectURI string `json:"redirect_uri"`
|
||||
}
|
||||
|
||||
type GiteeOAuthRequest struct {
|
||||
OAuthGetTokenRequest
|
||||
//'grant_type': 'authorization_code',
|
||||
GrantType string `json:"grant_type"`
|
||||
}
|
||||
|
||||
// github返回用户信息
|
||||
type GitHubUserInfo struct {
|
||||
LoginUserName string `json:"login"` // 用户名
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@ import (
|
|||
)
|
||||
|
||||
func GetGiteeAccessTokenByCode(code string, redirectURI string, clientID string, clientSecret string) (proto.GiteeOAuthTokenResponse, error) {
|
||||
req := proto.OAuthGetTokenRequest{
|
||||
req := proto.GiteeOAuthRequest{
|
||||
ClientID: clientID,
|
||||
ClientSecret: clientSecret,
|
||||
Code: code,
|
||||
RedirectURI: redirectURI,
|
||||
GrantType: "authorization_code",
|
||||
}
|
||||
var resp proto.GiteeOAuthTokenResponse
|
||||
reqBytes, err := json.Marshal(req)
|
||||
|
|
|
|||
Loading…
Reference in New Issue