Skip to content

Commit be4ac3b

Browse files
committed
fix: return old function for loading sidebar image
1 parent 3f38897 commit be4ac3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adminforth/spa/src/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ export const loadFile = (file: string) => {
9494
console.log('path', path);
9595
const fileModulePath = `./${path}`;
9696
console.log('imort.meta.url', import.meta.url);
97-
baseUrl = new URL(fileModulePath ,import.meta.url).href;
97+
baseUrl = new URL(`./${path}` ,import.meta.url).href;
9898
console.log('baseUrl', baseUrl);
9999
} else if (file.startsWith('@@/')) {
100100
path = file.replace('@@/', '');
101101
const fileModulePath = `./${path}`;
102-
baseUrl = new URL(fileModulePath, new URL(import.meta.url).origin + new URL(import.meta.url).pathname).href;
102+
baseUrl = new URL(`./${path}`, new URL(import.meta.url).origin + new URL(import.meta.url).pathname).href;
103103
} else {
104104
const fileModulePath = `./${file}`;
105-
baseUrl = new URL(fileModulePath, new URL(import.meta.url).origin + new URL(import.meta.url).pathname).href;
105+
baseUrl = new URL(`./${file}`, new URL(import.meta.url).origin + new URL(import.meta.url).pathname).href;
106106
}
107107
return baseUrl;
108108
}

0 commit comments

Comments
 (0)