Skip to content

Commit 4c95d9c

Browse files
committed
fix: no vite image prefix case
1 parent 69bf568 commit 4c95d9c

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/common/utils/getImageUrl.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
const prefixUrl = import.meta.env.VITE_IMAGE_PREFIX_URL || '';
2+
13
const getImageUrl = (imageUrl: string) => {
24
if (imageUrl.startsWith('http')) {
35
return imageUrl;
46
}
5-
const prefixUrl = import.meta.env.VITE_IMAGE_PREFIX_URL || '';
6-
if (!prefixUrl) {
7-
throw new Error('VITE_IMAGE_PREFIX_URL is not defined or is empty.');
8-
}
7+
98
return `${prefixUrl}/${imageUrl}`;
109
};
1110

0 commit comments

Comments
 (0)