mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: preview shared text/doc file
This commit is contained in:
@@ -128,6 +128,11 @@ func (service *SingleFileService) CreateDocPreviewSession(ctx context.Context, c
|
||||
}
|
||||
defer fs.Recycle()
|
||||
|
||||
// 如果上下文中已有File对象,则重设目标
|
||||
if file, ok := ctx.Value(fsctx.FileModelCtx).(*model.File); ok {
|
||||
fs.SetTargetFile(&[]model.File{*file})
|
||||
}
|
||||
|
||||
// 获取文件临时下载地址
|
||||
downloadURL, err := fs.GetDownloadURL(ctx, service.Path, "doc_preview_timeout")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user