From 8b27466a5a430c5c638f2b63523e57cec9f4090f Mon Sep 17 00:00:00 2001 From: shanshuirenjia <978987373@qq.com> Date: Wed, 5 Jan 2022 15:49:27 +0800 Subject: [PATCH] repair image's access-token expired bug --- frontend/src/markdown-editor.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/markdown-editor.js b/frontend/src/markdown-editor.js index cfb2b66b3a..c5b0bbfdc3 100644 --- a/frontend/src/markdown-editor.js +++ b/frontend/src/markdown-editor.js @@ -736,9 +736,8 @@ class MarkdownEditor extends React.Component { const fileName = Utils.getFileName(filePath); const suffix = fileName.slice(fileName.indexOf('.') + 1); if (IMAGE_SUFFIXES.includes(suffix)) { - seafileAPI.getFileDownloadLink(repoID, filePath).then((res) => { - window.richMarkdownEditor.addLink(fileName, res.data, true); - }); + let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath) + '?raw=1'; + window.richMarkdownEditor.addLink(fileName, innerURL, true); return; } let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath);