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

@ -11,6 +11,7 @@ import (
"github.com/alist-org/alist/v3/internal/fs"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/sign"
"github.com/alist-org/alist/v3/pkg/utils"
"github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin"
)
@ -245,7 +246,10 @@ func Link(c *gin.Context) {
}
if storage.Config().OnlyLocal {
common.SuccessResp(c, model.Link{
URL: fmt.Sprintf("%s/p%s?d&sign=%s", common.GetBaseUrl(c.Request), req.Path, sign.Sign(stdpath.Base(rawPath))),
URL: fmt.Sprintf("%s/p%s?d&sign=%s",
common.GetApiUrl(c.Request),
utils.EncodePath(req.Path),
sign.Sign(stdpath.Base(rawPath))),
})
return
}