Feat: sign file source url

This commit is contained in:
HFO4
2019-12-10 17:10:34 +08:00
parent 1963a495fb
commit 36d5f51495
15 changed files with 174 additions and 47 deletions

View File

@@ -3,6 +3,7 @@ package model
import (
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/jinzhu/gorm"
"net/url"
)
// Setting 系统设置模型
@@ -62,3 +63,12 @@ func GetSettingByType(types []string) map[string]string {
return res
}
// GetSiteURL 获取站点地址
func GetSiteURL() *url.URL {
base, err := url.Parse(GetSettingByName("siteURL"))
if err != nil {
base, _ = url.Parse("https://cloudreve.org")
}
return base
}