1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 18:29:23 +00:00

Merge pull request #5081 from haiwen/repair-md-image-shown-bug

repair image's access-token expired bug
This commit is contained in:
Daniel Pan
2022-01-05 16:27:24 +08:00
committed by GitHub

View File

@@ -736,9 +736,8 @@ class MarkdownEditor extends React.Component {
const fileName = Utils.getFileName(filePath); const fileName = Utils.getFileName(filePath);
const suffix = fileName.slice(fileName.indexOf('.') + 1); const suffix = fileName.slice(fileName.indexOf('.') + 1);
if (IMAGE_SUFFIXES.includes(suffix)) { if (IMAGE_SUFFIXES.includes(suffix)) {
seafileAPI.getFileDownloadLink(repoID, filePath).then((res) => { let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath) + '?raw=1';
window.richMarkdownEditor.addLink(fileName, res.data, true); window.richMarkdownEditor.addLink(fileName, innerURL, true);
});
return; return;
} }
let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath); let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath);