1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 18:30:53 +00:00

repair code bug (#4497)

This commit is contained in:
杨顺强
2020-03-24 20:12:29 +08:00
committed by GitHub
parent 0649f71545
commit c97e901a73

View File

@@ -50,9 +50,10 @@ class FileContent extends React.Component {
return;
}
// get image path
let index = imageUrl.indexOf('/file');
let index2 = imageUrl.indexOf('?');
const imagePath = imageUrl.substring(index + 5, index2);
let imagePath = imageUrl.substring(serviceURL.length);
let index = imagePath.indexOf('/file');
let index2 = imagePath.indexOf('?');
imagePath = imagePath.substring(index + 5, index2);
// change image url
innerNode.data.src = serviceURL + '/view-image-via-share-link/?token=' + sharedToken + '&path=' + imagePath;
}