mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 04:14:46 +08:00
fix: decode URL
This commit is contained in:
@@ -46,7 +46,7 @@ export function ArtifactFileDetail({
|
|||||||
const filepath = useMemo(() => {
|
const filepath = useMemo(() => {
|
||||||
if (isWriteFile) {
|
if (isWriteFile) {
|
||||||
const url = new URL(filepathFromProps);
|
const url = new URL(filepathFromProps);
|
||||||
return url.pathname;
|
return decodeURIComponent(url.pathname);
|
||||||
}
|
}
|
||||||
return filepathFromProps;
|
return filepathFromProps;
|
||||||
}, [filepathFromProps, isWriteFile]);
|
}, [filepathFromProps, isWriteFile]);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function FileViewer({
|
|||||||
const { isCodeFile, language } = useMemo(() => {
|
const { isCodeFile, language } = useMemo(() => {
|
||||||
if (isWriteFile) {
|
if (isWriteFile) {
|
||||||
const url = new URL(filepath);
|
const url = new URL(filepath);
|
||||||
const path = url.pathname;
|
const path = decodeURIComponent(url.pathname);
|
||||||
return checkCodeFile(path);
|
return checkCodeFile(path);
|
||||||
}
|
}
|
||||||
return checkCodeFile(filepath);
|
return checkCodeFile(filepath);
|
||||||
|
|||||||
Reference in New Issue
Block a user