mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 01:44:13 +00:00
fix rotate image path have Chinese charactors (#6898)
This commit is contained in:
@@ -34,6 +34,7 @@ const ImagePreviewer = (props) => {
|
|||||||
thumbnail: `${siteRoot}thumbnail/${repoID}/${thumbnailSizeForOriginal}${path}`,
|
thumbnail: `${siteRoot}thumbnail/${repoID}/${thumbnailSizeForOriginal}${path}`,
|
||||||
src: src,
|
src: src,
|
||||||
downloadURL: `${fileServerRoot}repos/${repoID}/files${path}/?op=download`,
|
downloadURL: `${fileServerRoot}repos/${repoID}/files${path}/?op=download`,
|
||||||
|
rawPath: Utils.joinPath(parentDir, fileName),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
setImageItems(newImageItems);
|
setImageItems(newImageItems);
|
||||||
@@ -60,7 +61,7 @@ const ImagePreviewer = (props) => {
|
|||||||
if (imageIndex >= 0 && angle !== 0) {
|
if (imageIndex >= 0 && angle !== 0) {
|
||||||
const repoID = window.sfMetadataContext.getSetting('repoID');
|
const repoID = window.sfMetadataContext.getSetting('repoID');
|
||||||
const imageItem = imageItems[imageIndex];
|
const imageItem = imageItems[imageIndex];
|
||||||
const path = imageItem.url.slice(imageItem.url.indexOf('/file/') + 5);
|
const path = imageItem.rawPath;
|
||||||
imageAPI.rotateImage(repoID, path, 360 - angle).then((res) => {
|
imageAPI.rotateImage(repoID, path, 360 - angle).then((res) => {
|
||||||
if (res.data?.success) {
|
if (res.data?.success) {
|
||||||
seafileAPI.createThumbnail(repoID, path, thumbnailDefaultSize).then((res) => {
|
seafileAPI.createThumbnail(repoID, path, thumbnailDefaultSize).then((res) => {
|
||||||
|
Reference in New Issue
Block a user