mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-11 09:08:14 +08:00
🐛 修复分享图米游铺icon渲染异常
This commit is contained in:
@@ -67,6 +67,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://*.mihoyo.com/*"
|
"url": "https://*.mihoyo.com/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://*.mihoyogift.com/*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,11 @@
|
|||||||
{ "identifier": "fs:allow-write-text-file", "allow": [{ "path": "**" }] },
|
{ "identifier": "fs:allow-write-text-file", "allow": [{ "path": "**" }] },
|
||||||
{
|
{
|
||||||
"identifier": "http:default",
|
"identifier": "http:default",
|
||||||
"allow": [{ "url": "https://*.miyoushe.com/*" }, { "url": "https://*.mihoyo.com/*" }]
|
"allow": [
|
||||||
|
{ "url": "https://*.miyoushe.com/*" },
|
||||||
|
{ "url": "https://*.mihoyo.com/*" },
|
||||||
|
{ "url": "https://*.mihoyogift.com/*" }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"platforms": ["windows", "macOS"]
|
"platforms": ["windows", "macOS"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tp-link-card-box">
|
<div class="tp-link-card-box">
|
||||||
<img :src="props.data.insert.link_card.cover" alt="cover" @click="toLink()" />
|
<img :src="cover" alt="cover" @click="toLink()" />
|
||||||
<div class="tp-link-card-content">
|
<div class="tp-link-card-content">
|
||||||
<span>{{ props.data.insert.link_card.title }}</span>
|
<span>{{ props.data.insert.link_card.title }}</span>
|
||||||
<div v-if="props.data.insert.link_card.price" class="tp-link-card-price">
|
<div v-if="props.data.insert.link_card.price" class="tp-link-card-price">
|
||||||
@@ -13,10 +13,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { toRaw } from "vue";
|
import { onMounted, toRaw, ref, onUnmounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
import { parseLink, parsePost } from "../../utils/linkParser.js";
|
import { parseLink, parsePost } from "../../utils/linkParser.js";
|
||||||
|
import { saveImgLocal } from "../../utils/TGShare.js";
|
||||||
import showSnackbar from "../func/snackbar.js";
|
import showSnackbar from "../func/snackbar.js";
|
||||||
|
|
||||||
interface TpLinkCard {
|
interface TpLinkCard {
|
||||||
@@ -44,6 +45,20 @@ interface TpLinkCardProps {
|
|||||||
const props = defineProps<TpLinkCardProps>();
|
const props = defineProps<TpLinkCardProps>();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
const cover = ref<string>(props.data.insert.link_card.cover);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
if (!cover.value.startsWith("blob:")) {
|
||||||
|
cover.value = await saveImgLocal(props.data.insert.link_card.cover);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (cover.value.startsWith("blob:")) {
|
||||||
|
URL.revokeObjectURL(cover.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
console.log("tpLinkCard", props.data.insert.link_card.card_id, toRaw(props.data).insert.link_card);
|
console.log("tpLinkCard", props.data.insert.link_card.card_id, toRaw(props.data).insert.link_card);
|
||||||
|
|
||||||
async function toLink() {
|
async function toLink() {
|
||||||
|
|||||||
Reference in New Issue
Block a user