image proxy

This commit is contained in:
jxxghp
2024-01-05 21:35:33 +08:00
parent d02fe55a1e
commit ace7a6621f
4 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "moviepilot", "name": "moviepilot",
"version": "1.5.7-1", "version": "1.5.7-2",
"private": true, "private": true,
"bin": "dist/service.js", "bin": "dist/service.js",
"scripts": { "scripts": {
+7 -1
View File
@@ -21,6 +21,12 @@ function goPlay() {
if (props.media?.link) if (props.media?.link)
window.open(props.media?.link, '_blank') window.open(props.media?.link, '_blank')
} }
// 计算图片地址
const getImgUrl = computed(() => {
const image = props.media?.image || ''
return `${import.meta.env.VITE_API_BASE_URL}system/img/${encodeURIComponent(image)}`
})
</script> </script>
<template> <template>
@@ -43,7 +49,7 @@ function goPlay() {
> >
<template #image> <template #image>
<VImg <VImg
:src="props.media?.image" :src="getImgUrl"
aspect-ratio="2/3" aspect-ratio="2/3"
cover cover
@load="imageLoadHandler" @load="imageLoadHandler"
+2 -1
View File
@@ -18,7 +18,8 @@ function imageLoadHandler() {
// 计算图片地址 // 计算图片地址
const getImgUrl = computed(() => { const getImgUrl = computed(() => {
return props.media?.image || props.media?.image_list?.[0] const image = props.media?.image || props.media?.image_list?.[0] || ''
return `${import.meta.env.VITE_API_BASE_URL}system/img/${encodeURIComponent(image)}`
}) })
// 跳转播放 // 跳转播放
+2 -1
View File
@@ -30,7 +30,8 @@ function getChipColor(type: string) {
const getImgUrl = computed(() => { const getImgUrl = computed(() => {
if (imageLoadError.value) if (imageLoadError.value)
return noImage return noImage
return props.media?.image const image = props.media?.image || ''
return `${import.meta.env.VITE_API_BASE_URL}system/img/${encodeURIComponent(image)}`
}) })
// 跳转播放 // 跳转播放