feat: local storage image thumbnail

This commit is contained in:
Noah Hsu
2022-08-11 20:32:17 +08:00
parent fda4db71bf
commit af884010d1
19 changed files with 178 additions and 61 deletions

View File

@ -9,15 +9,17 @@ import (
"github.com/alist-org/alist/v3/internal/setting"
)
func GetBaseUrl(r *http.Request) string {
baseUrl := setting.GetByKey(conf.ApiUrl)
func GetApiUrl(r *http.Request) string {
api := setting.GetByKey(conf.ApiUrl)
protocol := "http"
if r.TLS != nil {
protocol = "https"
if r != nil {
if r.TLS != nil {
protocol = "https"
}
if api == "" {
api = fmt.Sprintf("%s://%s", protocol, r.Host)
}
}
if baseUrl == "" {
baseUrl = fmt.Sprintf("%s://%s", protocol, r.Host)
}
strings.TrimSuffix(baseUrl, "/")
return baseUrl
strings.TrimSuffix(api, "/")
return api
}