mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: sign file source url
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user