1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

repair code bug

This commit is contained in:
shanshuirenjia
2022-01-18 17:28:10 +08:00
parent c90e6833d5
commit cd44343b98
2 changed files with 3 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ const { siteRoot, serviceUrl, seafileCollabServer } = window.app.config;
const userInfo = window.app.userInfo; const userInfo = window.app.userInfo;
const userName = userInfo.username; const userName = userInfo.username;
let dirPath = Utils.getDirName(filePath); let dirPath = Utils.getDirName(filePath);
const IMAGE_SUFFIXES = ['png', 'PNG', 'jpg', 'JPG', 'gif', 'GIF']; const IMAGE_SUFFIXES = ['png', 'PNG', 'jpg', 'jpeg', 'JPG', 'gif', 'GIF'];
function getImageFileNameWithTimestamp() { function getImageFileNameWithTimestamp() {
var d = Date.now(); var d = Date.now();
@@ -734,7 +734,7 @@ 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)) {
let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath) + '?raw=1'; let innerURL = serviceUrl + '/lib/' + repoID + '/file' + filePath + '?raw=1';
window.richMarkdownEditor.addLink(fileName, innerURL, true); window.richMarkdownEditor.addLink(fileName, innerURL, true);
return; return;
} }

View File

@@ -55,7 +55,7 @@ class FileContent extends React.Component {
let index2 = imagePath.indexOf('?'); let index2 = imagePath.indexOf('?');
imagePath = imagePath.substring(index + 5, index2); imagePath = imagePath.substring(index + 5, index2);
// change image url // change image url
innerNode.data.src = serviceURL + '/view-image-via-share-link/?token=' + sharedToken + '&path=' + Utils.encodePath(imagePath); innerNode.data.src = serviceURL + '/view-image-via-share-link/?token=' + sharedToken + '&path=' + imagePath;
} }
return innerNode; return innerNode;
} }