mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-02 22:31:07 +08:00
image proxy
This commit is contained in:
@@ -21,6 +21,12 @@ function goPlay() {
|
||||
if (props.media?.link)
|
||||
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>
|
||||
|
||||
<template>
|
||||
@@ -43,7 +49,7 @@ function goPlay() {
|
||||
>
|
||||
<template #image>
|
||||
<VImg
|
||||
:src="props.media?.image"
|
||||
:src="getImgUrl"
|
||||
aspect-ratio="2/3"
|
||||
cover
|
||||
@load="imageLoadHandler"
|
||||
|
||||
@@ -18,7 +18,8 @@ function imageLoadHandler() {
|
||||
|
||||
// 计算图片地址
|
||||
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)}`
|
||||
})
|
||||
|
||||
// 跳转播放
|
||||
|
||||
@@ -30,7 +30,8 @@ function getChipColor(type: string) {
|
||||
const getImgUrl = computed(() => {
|
||||
if (imageLoadError.value)
|
||||
return noImage
|
||||
return props.media?.image
|
||||
const image = props.media?.image || ''
|
||||
return `${import.meta.env.VITE_API_BASE_URL}system/img/${encodeURIComponent(image)}`
|
||||
})
|
||||
|
||||
// 跳转播放
|
||||
|
||||
Reference in New Issue
Block a user