fix(local): add sign to thumbnail (close #2536 close #2650)

This commit is contained in:
Noah Hsu 2022-12-09 10:07:17 +08:00
parent 6f1aeb47fd
commit 446f82888c

View File

@ -18,6 +18,7 @@ import (
"github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/errs"
"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/disintegration/imaging"
@ -76,7 +77,7 @@ func (d *Local) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([
if d.Thumbnail && utils.GetFileType(f.Name()) == conf.IMAGE {
thumb = common.GetApiUrl(nil) + stdpath.Join("/d", args.ReqPath, f.Name())
thumb = utils.EncodePath(thumb, true)
thumb += "?type=thumb"
thumb += "?type=thumb&sign=" + sign.Sign(stdpath.Join(args.ReqPath, f.Name()))
}
isFolder := f.IsDir() || isSymlinkDir(f, fullPath)
size := f.Size()