✨ github oauth2 login /gitee oauth2 login
This commit is contained in:
21
config/conf_oauth.go
Normal file
21
config/conf_oauth.go
Normal 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"`
|
||||
}
|
@@ -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 {
|
||||
|
@@ -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"`
|
||||
}
|
||||
|
@@ -9,4 +9,5 @@ type Config struct {
|
||||
JWT JWT `yaml:"jwt"`
|
||||
Encrypt Encrypt `yaml:"encrypt"`
|
||||
Wechat Wechat `yaml:"wechat"`
|
||||
OAuth OAuth `yaml:"oauth"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user