lejianwen месяцев назад: 11
Родитель
Сommit
d486444680
3 измененных файлов с 5 добавлено и 1 удалено
  1. 1 0
      conf/config.yaml
  2. 1 0
      config/config.go
  3. 3 1
      http/controller/api/login.go

+ 1 - 0
conf/config.yaml

@@ -4,6 +4,7 @@ app:
4
   register: false #是否开启注册
4
   register: false #是否开启注册
5
   show-swagger: 0 # 1:启用 0:禁用
5
   show-swagger: 0 # 1:启用 0:禁用
6
   token-expire: 360000
6
   token-expire: 360000
7
+  web-sso: true #web auth sso
7
 admin:
8
 admin:
8
   title: "RustDesk Api Admin"
9
   title: "RustDesk Api Admin"
9
   hello-file: "./conf/admin/hello.html"  #优先使用file
10
   hello-file: "./conf/admin/hello.html"  #优先使用file

+ 1 - 0
config/config.go

@@ -17,6 +17,7 @@ type App struct {
17
 	Register    bool `mapstructure:"register"`
17
 	Register    bool `mapstructure:"register"`
18
 	ShowSwagger int  `mapstructure:"show-swagger"`
18
 	ShowSwagger int  `mapstructure:"show-swagger"`
19
 	TokenExpire int  `mapstructure:"token-expire"`
19
 	TokenExpire int  `mapstructure:"token-expire"`
20
+	WebSso      bool `mapstructure:"web-sso"`
20
 }
21
 }
21
 type Admin struct {
22
 type Admin struct {
22
 	Title     string `mapstructure:"title"`
23
 	Title     string `mapstructure:"title"`

+ 3 - 1
http/controller/api/login.go

@@ -85,7 +85,9 @@ func (l *Login) Login(c *gin.Context) {
85
 // @Router /login-options [get]
85
 // @Router /login-options [get]
86
 func (l *Login) LoginOptions(c *gin.Context) {
86
 func (l *Login) LoginOptions(c *gin.Context) {
87
 	ops := service.AllService.OauthService.GetOauthProviders()
87
 	ops := service.AllService.OauthService.GetOauthProviders()
88
-	ops = append(ops, model.OauthTypeWebauth)
88
+	if global.Config.App.WebSso {
89
+		ops = append(ops, model.OauthTypeWebauth)
90
+	}
89
 	var oidcItems []map[string]string
91
 	var oidcItems []map[string]string
90
 	for _, v := range ops {
92
 	for _, v := range ops {
91
 		oidcItems = append(oidcItems, map[string]string{"name": v})
93
 		oidcItems = append(oidcItems, map[string]string{"name": v})