Merge branch 'master' of https://github.com/cloudreve/Cloudreve
This commit is contained in:
commit
b02d27ca0a
3 changed files with 4 additions and 0 deletions
|
@ -76,6 +76,7 @@ func addDefaultSettings() {
|
||||||
defaultSettings := []Setting{
|
defaultSettings := []Setting{
|
||||||
{Name: "siteURL", Value: `http://localhost`, Type: "basic"},
|
{Name: "siteURL", Value: `http://localhost`, Type: "basic"},
|
||||||
{Name: "siteName", Value: `Cloudreve`, Type: "basic"},
|
{Name: "siteName", Value: `Cloudreve`, Type: "basic"},
|
||||||
|
{Name: "siteICPId", Value: ``, Type: "basic"},
|
||||||
{Name: "register_enabled", Value: `1`, Type: "register"},
|
{Name: "register_enabled", Value: `1`, Type: "register"},
|
||||||
{Name: "default_group", Value: `2`, Type: "register"},
|
{Name: "default_group", Value: `2`, Type: "register"},
|
||||||
{Name: "siteKeywords", Value: `网盘,网盘`, Type: "basic"},
|
{Name: "siteKeywords", Value: `网盘,网盘`, Type: "basic"},
|
||||||
|
|
|
@ -5,6 +5,7 @@ import model "github.com/HFO4/cloudreve/models"
|
||||||
// SiteConfig 站点全局设置序列
|
// SiteConfig 站点全局设置序列
|
||||||
type SiteConfig struct {
|
type SiteConfig struct {
|
||||||
SiteName string `json:"title"`
|
SiteName string `json:"title"`
|
||||||
|
SiteICPId string `json:"siteICPId"`
|
||||||
LoginCaptcha bool `json:"loginCaptcha"`
|
LoginCaptcha bool `json:"loginCaptcha"`
|
||||||
RegCaptcha bool `json:"regCaptcha"`
|
RegCaptcha bool `json:"regCaptcha"`
|
||||||
ForgetCaptcha bool `json:"forgetCaptcha"`
|
ForgetCaptcha bool `json:"forgetCaptcha"`
|
||||||
|
@ -64,6 +65,7 @@ func BuildSiteConfig(settings map[string]string, user *model.User) Response {
|
||||||
res := Response{
|
res := Response{
|
||||||
Data: SiteConfig{
|
Data: SiteConfig{
|
||||||
SiteName: checkSettingValue(settings, "siteName"),
|
SiteName: checkSettingValue(settings, "siteName"),
|
||||||
|
SiteICPId: checkSettingValue(settings, "siteICPId"),
|
||||||
LoginCaptcha: model.IsTrueVal(checkSettingValue(settings, "login_captcha")),
|
LoginCaptcha: model.IsTrueVal(checkSettingValue(settings, "login_captcha")),
|
||||||
RegCaptcha: model.IsTrueVal(checkSettingValue(settings, "reg_captcha")),
|
RegCaptcha: model.IsTrueVal(checkSettingValue(settings, "reg_captcha")),
|
||||||
ForgetCaptcha: model.IsTrueVal(checkSettingValue(settings, "forget_captcha")),
|
ForgetCaptcha: model.IsTrueVal(checkSettingValue(settings, "forget_captcha")),
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
func SiteConfig(c *gin.Context) {
|
func SiteConfig(c *gin.Context) {
|
||||||
siteConfig := model.GetSettingByNames(
|
siteConfig := model.GetSettingByNames(
|
||||||
"siteName",
|
"siteName",
|
||||||
|
"siteICPId",
|
||||||
"login_captcha",
|
"login_captcha",
|
||||||
"reg_captcha",
|
"reg_captcha",
|
||||||
"email_active",
|
"email_active",
|
||||||
|
|
Loading…
Add table
Reference in a new issue