mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: GET Site/Config getting global configuration
This commit is contained in:
24
routers/controllers/site.go
Normal file
24
routers/controllers/site.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
model "github.com/HFO4/cloudreve/models"
|
||||
"github.com/HFO4/cloudreve/pkg/serializer"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// SiteConfig 获取站点全局配置
|
||||
func SiteConfig(c *gin.Context) {
|
||||
siteConfig := model.GetSettingByNames([]string{
|
||||
"siteName",
|
||||
"login_captcha",
|
||||
"qq_login",
|
||||
"reg_captcha",
|
||||
"email_active",
|
||||
"forget_captcha",
|
||||
"email_active",
|
||||
"themes",
|
||||
"defaultTheme",
|
||||
})
|
||||
|
||||
c.JSON(200, serializer.BuildSiteConfig(siteConfig))
|
||||
}
|
||||
Reference in New Issue
Block a user