mirror of https://github.com/Xhofe/alist
chore: add base path setting
parent
fb23758d12
commit
9ba7cf0835
|
@ -68,7 +68,8 @@ func initialSettings() {
|
|||
initialSettingItems = []model.SettingItem{
|
||||
// site settings
|
||||
{Key: conf.VERSION, Value: conf.Version, Type: conf.TypeString, Group: model.SITE, Flag: model.READONLY},
|
||||
{Key: conf.BaseUrl, Value: "", Type: conf.TypeString, Group: model.SITE},
|
||||
{Key: conf.ApiUrl, Value: "", Type: conf.TypeString, Group: model.SITE},
|
||||
{Key: conf.BasePath, Value: "", Type: conf.TypeString, Group: model.SITE},
|
||||
{Key: conf.SiteTitle, Value: "AList", Type: conf.TypeString, Group: model.SITE},
|
||||
{Key: conf.SiteLogo, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.SITE},
|
||||
{Key: conf.Favicon, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.SITE},
|
||||
|
|
|
@ -10,7 +10,8 @@ const (
|
|||
|
||||
const (
|
||||
VERSION = "version"
|
||||
BaseUrl = "base_url"
|
||||
ApiUrl = "api_url"
|
||||
BasePath = "base_path"
|
||||
SiteTitle = "site_title"
|
||||
SiteLogo = "site_logo"
|
||||
Favicon = "favicon"
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
)
|
||||
|
||||
func GetBaseUrl(r *http.Request) string {
|
||||
baseUrl := setting.GetByKey(conf.BaseUrl)
|
||||
baseUrl := setting.GetByKey(conf.ApiUrl)
|
||||
protocol := "http"
|
||||
if r.TLS != nil {
|
||||
protocol = "https"
|
||||
|
|
Loading…
Reference in New Issue