Skip to content

Commit

Permalink
feat(doc preview): add magic variable for file name
Browse files Browse the repository at this point in the history
  • Loading branch information
HFO4 committed Dec 16, 2022
1 parent 435a03d commit 9860ebb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions service/explorer/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
}
}
Expand Down

0 comments on commit 9860ebb

Please sign in to comment.