From 14144441759cb3be33b6dee01aea3d3f572457e2 Mon Sep 17 00:00:00 2001 From: speakeloudest Date: Mon, 30 Mar 2026 06:03:15 +0300 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=93=BE=E6=8E=A5=E5=B8=A6?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DownloadMethodList/DownloadMethodList.vue | 10 ++++- src/pages/Help/index.vue | 25 +++++++++--- src/pages/Home/components/DownloadButton.vue | 39 +++++++++++++------ src/pages/Home/index.vue | 5 +++ src/pages/Reviews/index.vue | 11 +++++- 5 files changed, 72 insertions(+), 18 deletions(-) diff --git a/src/pages/Help/DownloadMethodList/DownloadMethodList.vue b/src/pages/Help/DownloadMethodList/DownloadMethodList.vue index bd51378..1e7648e 100644 --- a/src/pages/Help/DownloadMethodList/DownloadMethodList.vue +++ b/src/pages/Help/DownloadMethodList/DownloadMethodList.vue @@ -155,7 +155,15 @@ import m3_3 from './mobile3/row-3-column-1.webp' import pc3_1 from './pc3/row-1-column-1.webp' import pc3_2 from './pc3/row-2-column-1.webp' import pc3_3 from './pc3/row-3-column-1.webp' -import { downLoadIos } from '@/utils/constant.ts' +import { getAllQueryString } from '@/utils/url-utils.ts' + +const ic = getAllQueryString('ic') || sessionStorage.getItem('ic') +const ADJ_GO_LINK = + ic && typeof ic === 'string' + ? `https://hifastvpn.go.link?adj_t=1xf6e7ru&inviteCode=${ic}` + : 'https://hifastvpn.go.link/?adj_t=1xf6e7ru' + +const downLoadIos = ADJ_GO_LINK interface Hotzone { x: number diff --git a/src/pages/Help/index.vue b/src/pages/Help/index.vue index 3f61759..502cda4 100644 --- a/src/pages/Help/index.vue +++ b/src/pages/Help/index.vue @@ -130,14 +130,29 @@ import { getAllQueryString } from '@/utils/url-utils.ts' import DownloadMethodList from './DownloadMethodList/DownloadMethodList.vue' import FAQAccordion from './FAQAccordion/index.vue' import { Button } from '@/components/ui/button' -import { downLoadIos } from '@/utils/constant.ts' + +const ic = getAllQueryString('ic') || sessionStorage.getItem('ic') +const ADJ_GO_LINK = + ic && typeof ic === 'string' + ? `https://hifastvpn.go.link?adj_t=1xf6e7ru&inviteCode=${ic}` + : 'https://hifastvpn.go.link/?adj_t=1xf6e7ru' + +const getTrackedUrl = (url: string) => { + if (!url) return '' + return `${ADJ_GO_LINK}&adj_redirect=${encodeURIComponent(url)}` +} const downLoadWin = ref( - 'https://api.hifast.biz/v1/common/client/download/file/Hi快VPN-windows-1.0.0.exe', + getTrackedUrl( + 'https://api.hifast.biz/v1/common/client/download/file/Hi快VPN-windows-1.0.0.exe', + ), ) -const downLoadMac = ref('https://apps.apple.com/us/app/hi%E5%BF%ABvpn/id6755683167') +const downLoadMac = ref(ADJ_GO_LINK) +const downLoadIos = ref(ADJ_GO_LINK) const downLoadAndroid = ref( - 'https://api.hifast.biz/v1/common/client/download/file/Hi快VPN-android-1.0.0.apk', + ic && typeof ic === 'string' + ? `https://hifastvpn.go.link?adj_t=1xf6e7ru&inviteCode=${ic}` + : 'https://api.hifast.biz/v1/common/client/download/file/Hi%E5%BF%ABVPN-android-1.0.0.apk', ) // request // .get('/api/v1/common/client/download', { @@ -176,7 +191,7 @@ const otherClients = computed(() => { ] }) -function changeActiveIndex(index) { +function changeActiveIndex(index: number) { activeIndex.value = index window.scrollTo(0, 0) } diff --git a/src/pages/Home/components/DownloadButton.vue b/src/pages/Home/components/DownloadButton.vue index f2f6e78..185bf88 100644 --- a/src/pages/Home/components/DownloadButton.vue +++ b/src/pages/Home/components/DownloadButton.vue @@ -120,10 +120,15 @@ onMounted(() => { // downLoadMac.value = res.url // }) -const ADJ_BASE_URL = 'https://hifastvpn.go.link/?adj_t=1xf6e7ru' +const ic = getAllQueryString('ic') || sessionStorage.getItem('ic') +const ADJ_GO_LINK = + ic && typeof ic === 'string' + ? `https://hifastvpn.go.link?adj_t=1xf6e7ru&inviteCode=${ic}` + : 'https://hifastvpn.go.link/?adj_t=1xf6e7ru' + const getTrackedUrl = (target: string) => { if (!target) return '' - return `${ADJ_BASE_URL}&adj_redirect=${encodeURIComponent(target)}` + return `${ADJ_GO_LINK}&adj_redirect=${encodeURIComponent(target)}` } const allDownloadOptions = computed(() => [ @@ -141,7 +146,7 @@ const allDownloadOptions = computed(() => [ key: 'mac', mainIcon: Icon3, secondaryIcon: MacIcon, - link: getTrackedUrl('https://apps.apple.com/us/app/hi%E5%BF%ABvpn/id6755683167'), + link: ADJ_GO_LINK, label: 'macOS', id: 'downloadButton_mac', }, @@ -149,7 +154,7 @@ const allDownloadOptions = computed(() => [ key: 'ios', mainIcon: Icon2, secondaryIcon: AppleIcon, - link: '/help', + link: ADJ_GO_LINK, label: 'iOS', id: 'downloadButton_apple', }, @@ -157,19 +162,31 @@ const allDownloadOptions = computed(() => [ key: 'android', mainIcon: Icon4, secondaryIcon: AndroidIcon, - link: getTrackedUrl( - 'https://api.hifast.biz/v1/common/client/download/file/Hi%E5%BF%ABVPN-android-1.0.0.apk', - ), + link: + ic && typeof ic === 'string' + ? `https://hifastvpn.go.link?adj_t=1xf6e7ru&inviteCode=${ic}` + : 'https://api.hifast.biz/v1/common/client/download/file/Hi%E5%BF%ABVPN-android-1.0.0.apk', label: 'Android', id: 'downloadButton_android', }, ]) const mainButton = computed(() => { - return ( - allDownloadOptions.value.find((opt) => opt.key === currentPlatform.value) || - allDownloadOptions.value[0] - ) + const platform = currentPlatform.value + const opt = + allDownloadOptions.value.find((opt) => opt.key === platform) || allDownloadOptions.value[0] + + if (['mac', 'android', 'ios'].includes(platform)) { + // Android 无邀请码时使用直传链接(即 opt.link) + if (platform === 'android' && !(ic && typeof ic === 'string')) { + return opt + } + return { + ...opt, + link: ADJ_GO_LINK, + } + } + return opt }) const otherButtons = computed(() => { diff --git a/src/pages/Home/index.vue b/src/pages/Home/index.vue index 8ec6878..e1868b4 100644 --- a/src/pages/Home/index.vue +++ b/src/pages/Home/index.vue @@ -164,6 +164,7 @@ import MobileLogo from './mobile-logo.svg?component' import ScreenshotMobile from './screenshot-mobile.png' import ScreenshotDesktop from './screenshot-desktop.webp' import request from '@/utils/request' +import { getAllQueryString } from '@/utils/url-utils.ts' const route = useRoute() const router = useRouter() @@ -195,6 +196,10 @@ const fetchUserInfo = async () => { } onMounted(() => { + const ic = getAllQueryString('ic') + if (ic && typeof ic === 'string') { + sessionStorage.setItem('ic', ic) + } fetchUserInfo() if (route.query.login === 'true') { openLoginModal() diff --git a/src/pages/Reviews/index.vue b/src/pages/Reviews/index.vue index e000426..2aa2d27 100644 --- a/src/pages/Reviews/index.vue +++ b/src/pages/Reviews/index.vue @@ -77,12 +77,21 @@