github oauth2 login /gitee oauth2 login

This commit is contained in:
landaiqing
2024-08-19 00:14:01 +08:00
parent 57964d39af
commit 08b2790bee
23 changed files with 783 additions and 138 deletions

21
config/conf_oauth.go Normal file
View File

@@ -0,0 +1,21 @@
package config
// OAuth is the configuration of OAuth.
type OAuth struct {
Github Github `yaml:"github"`
Gitee Gitee `yaml:"gitee"`
}
// Github and GiteeConfig are the configuration of Github and Gitee OAuth.
type Github struct {
ClientID string `yaml:"client-id"`
ClientSecret string `yaml:"client-secret"`
RedirectURI string `yaml:"redirect-uri"`
}
// Gitee is the configuration of Gitee OAuth.
type Gitee struct {
ClientID string `yaml:"client-id"`
ClientSecret string `yaml:"client-secret"`
RedirectURI string `yaml:"redirect-uri"`
}

View File

@@ -7,6 +7,7 @@ type System struct {
Host string `yaml:"host"` //主机地址
Port string `yaml:"port"` //端口号
Env string `yaml:"env"` //环境
Web string `yaml:"web"` //web地址
}
func (s *System) Addr() string {

View File

@@ -1,8 +1,8 @@
package config
type Wechat struct {
AppID string `json:"app-id"`
AppSecret string `json:"app-secret"`
Token string `json:"token"`
AESKey string `json:"aes-key"`
AppID string `yaml:"app-id"`
AppSecret string `yaml:"app-secret"`
Token string `yaml:"token"`
AESKey string `yaml:"aes-key"`
}

View File

@@ -9,4 +9,5 @@ type Config struct {
JWT JWT `yaml:"jwt"`
Encrypt Encrypt `yaml:"encrypt"`
Wechat Wechat `yaml:"wechat"`
OAuth OAuth `yaml:"oauth"`
}