diff --git a/package.json b/package.json index 88f9120c..23f68ece 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "surmon.me", - "version": "4.40.3", + "version": "4.40.4", "description": "Surmon.me blog", "author": "Surmon", "license": "MIT", diff --git a/src/components/flow/mobile/item.vue b/src/components/flow/mobile/item.vue index 95cd6eb2..4cc72e1f 100644 --- a/src/components/flow/mobile/item.vue +++ b/src/components/flow/mobile/item.vue @@ -15,7 +15,7 @@ article: Article }>() - const { cdnDomain } = useEnhancer() + const { router, cdnDomain, gState } = useEnhancer() const identityStore = useIdentityStore() const isLiked = computed(() => identityStore.isLikedPage(props.article.id)) const isHybrid = computed(() => isHybridType(props.article.origin)) @@ -23,7 +23,11 @@ const isOriginal = computed(() => isOriginalType(props.article.origin)) const handleClick = () => { - openNewWindow(getArticleDetailRoute(props.article.id)) + if (gState.userAgent.isWechat) { + router.push(getArticleDetailRoute(props.article.id)) + } else { + openNewWindow(getArticleDetailRoute(props.article.id)) + } } const getThumbnailURL = (url: string, format?: ImgProxyFormat) => { diff --git a/src/csr.ts b/src/csr.ts index b05dd3b7..7388491d 100644 --- a/src/csr.ts +++ b/src/csr.ts @@ -112,24 +112,26 @@ router.isReady().finally(() => { i18n.set(globalState.userAgent.isZhUser ? Language.Chinese : Language.English) // init user identity state store.stores.identity.initOnClient() - // title surprise - document.addEventListener( - 'visibilitychange', - (event) => { - // @ts-ignore - const isHidden = event.target?.hidden || event.target?.webkitHidden - const surprises = [ - // tltle: zero width character - // { favicon: '🌝', title: '​' }, - // { favicon: '⛔️', title: 'FORBIDDEN' }, - // { favicon: '⭕️', title: 'FBI WARNING' }, - { favicon: '🌱', title: META.en_sub_title } - ] - const index = Math.floor(Math.random() * surprises.length) - isHidden ? runTitler(surprises[index]) : resetTitler() - }, - false - ) + // title surprise (desktop only) + if (!globalState.userAgent.isMobile) { + document.addEventListener( + 'visibilitychange', + (event) => { + // @ts-ignore + const isHidden = event.target?.hidden || event.target?.webkitHidden + const surprises = [ + // tltle: zero width character + // { favicon: '🌝', title: '​' }, + // { favicon: '⛔️', title: 'FORBIDDEN' }, + // { favicon: '⭕️', title: 'FBI WARNING' }, + { favicon: '🌱', title: META.en_sub_title } + ] + const index = Math.floor(Math.random() * surprises.length) + isHidden ? runTitler(surprises[index]) : resetTitler() + }, + false + ) + } // production only if (isProd) { consoleSlogan(i18n.t(LanguageKey.APP_SLOGAN)!, store.stores.appOption.data?.site_email)