feat(doc preview): add magic variable for file name
This commit is contained in:
parent
435a03dd34
commit
9860ebbca9
1 changed files with 2 additions and 0 deletions
|
@ -230,11 +230,13 @@ func (service *FileIDService) CreateDocPreviewSession(ctx context.Context, c *gi
|
||||||
srcB64 := base64.StdEncoding.EncodeToString([]byte(downloadURL))
|
srcB64 := base64.StdEncoding.EncodeToString([]byte(downloadURL))
|
||||||
srcEncoded := url.QueryEscape(downloadURL)
|
srcEncoded := url.QueryEscape(downloadURL)
|
||||||
srcB64Encoded := url.QueryEscape(srcB64)
|
srcB64Encoded := url.QueryEscape(srcB64)
|
||||||
|
|
||||||
return serializer.Response{
|
return serializer.Response{
|
||||||
Code: 0,
|
Code: 0,
|
||||||
Data: util.Replace(map[string]string{
|
Data: util.Replace(map[string]string{
|
||||||
"{$src}": srcEncoded,
|
"{$src}": srcEncoded,
|
||||||
"{$srcB64}": srcB64Encoded,
|
"{$srcB64}": srcB64Encoded,
|
||||||
|
"{$name}": url.QueryEscape(fs.FileTarget[0].Name),
|
||||||
}, model.GetSettingByName("office_preview_service")),
|
}, model.GetSettingByName("office_preview_service")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue