Skip to content

Commit

Permalink
Fix thumbnail url
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby committed Aug 28, 2024
1 parent 47860bd commit 7c6f5a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion console/src/components/MediaCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ const getExtname = (type?: string) => {
const imageThumbnailUrl = computed(() => {
const { url } = props.media || {};
return `/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=${url}&size=s`;
return `/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=${encodeURI(
url || ""
)}&size=s`;
});
</script>
<template>
Expand Down
4 changes: 3 additions & 1 deletion console/src/components/MomentPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ const getExtname = (type?: string) => {
function getImageThumbnailUrl(media: MomentMedia) {
const { url } = media || {};
return `/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=${url}&size=s`;
return `/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=${encodeURI(
url || ""
)}&size=s`;
}
</script>
<template>
Expand Down

0 comments on commit 7c6f5a8

Please sign in to comment.