Feat experimental WebAuth API

This commit is contained in:
HFO4
2019-12-08 22:17:36 +08:00
parent 0932a10fed
commit f35c585edf
14 changed files with 269 additions and 6 deletions

View File

@ -2,6 +2,7 @@ package local
import (
"context"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/util"
"io"
"os"
@ -82,3 +83,16 @@ func (handler Handler) Delete(ctx context.Context, files []string) ([]string, er
return deleteFailed, retErr
}
// Thumb 获取文件缩略图
func (handler Handler) Thumb(ctx context.Context, path string) (*response.ContentResponse, error) {
file, err := handler.Get(ctx, path+"._thumb")
if err != nil {
return nil, err
}
return &response.ContentResponse{
Redirect: false,
Content: file,
}, nil
}