feat: fs link api
This commit is contained in:
18
server/common/base.go
Normal file
18
server/common/base.go
Normal file
@ -0,0 +1,18 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/alist-org/alist/v3/internal/conf"
|
||||
"github.com/alist-org/alist/v3/internal/setting"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GetBaseUrl(r *http.Request) string {
|
||||
baseUrl := setting.GetByKey(conf.BaseUrl)
|
||||
if baseUrl == "" {
|
||||
baseUrl = fmt.Sprintf("//%s", r.Host)
|
||||
}
|
||||
strings.TrimSuffix(baseUrl, "/")
|
||||
return baseUrl
|
||||
}
|
Reference in New Issue
Block a user