From 9860ebbca94f1fcd5b5189ad33434569c2e5ac64 Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Fri, 16 Dec 2022 16:55:47 +0800 Subject: [PATCH] feat(doc preview): add magic variable for file name --- service/explorer/file.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/explorer/file.go b/service/explorer/file.go index 246d4a7dd1..b6d5f58d6d 100644 --- a/service/explorer/file.go +++ b/service/explorer/file.go @@ -230,11 +230,13 @@ func (service *FileIDService) CreateDocPreviewSession(ctx context.Context, c *gi srcB64 := base64.StdEncoding.EncodeToString([]byte(downloadURL)) srcEncoded := url.QueryEscape(downloadURL) srcB64Encoded := url.QueryEscape(srcB64) + return serializer.Response{ Code: 0, Data: util.Replace(map[string]string{ "{$src}": srcEncoded, "{$srcB64}": srcB64Encoded, + "{$name}": url.QueryEscape(fs.FileTarget[0].Name), }, model.GetSettingByName("office_preview_service")), } }