From cb6820053f64e12ccc7d86d16a3dda824f03dc7e Mon Sep 17 00:00:00 2001 From: AuroraHuang22 Date: Sun, 29 Sep 2024 14:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Add=20computed=20property=20for?= =?UTF-8?q?=20newsPress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/nft/url/index.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/nft/url/index.vue b/pages/nft/url/index.vue index 560cbb3f..541f903f 100644 --- a/pages/nft/url/index.vue +++ b/pages/nft/url/index.vue @@ -355,6 +355,10 @@ export default class FetchIndex extends Vue { return new RegExp(ISCN_PREFIX_REGEX); } + get isNewsPress() { + return !!this.$route.query.news_press && this.$route.query.news_press !== '0' + } + async mounted() { if (this.iscnId) { if (!this.isUpdateMode) { @@ -643,13 +647,12 @@ export default class FetchIndex extends Vue { } async crawlUrlData() { - const isNewsPress = !!this.$route.query.news_press && this.$route.query.news_press !== '0' try { logTrackerEvent(this, 'NFTUrlMint', 'CrawlUrlData', this.url, 1); const { data } = await this.$axios.get(`/crawler/?url=${encodeURIComponent(this.encodedURL)}&wallet=${this.address}`) const { title, description, author, body, images = [] } = data; let { keywords } = data; - if (isNewsPress) { + if (this.isNewsPress) { keywords = keywords ? `${keywords},NewsPress` : 'NewsPress'; } if (!body) { throw new Error('CANNOT_CRAWL_THIS_URL') }