From 4df560445bee7fb1dc58aaee29b69d30b4ad75a0 Mon Sep 17 00:00:00 2001 From: AuroraHuang22 Date: Sun, 29 Sep 2024 13:22:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Add=20tag=20if=20crawl=20URL=20i?= =?UTF-8?q?ncludes=20news=5Fpress?= 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..34b95ebc 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.url.includes('news_press=1') + } + 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') }