diff --git a/src/pages/Home/components/DownloadButton.vue b/src/pages/Home/components/DownloadButton.vue index d03c52f..6599b9d 100644 --- a/src/pages/Home/components/DownloadButton.vue +++ b/src/pages/Home/components/DownloadButton.vue @@ -100,12 +100,12 @@ onMounted(() => { console.log('Detected Platform:', currentPlatform.value); }); -request.get('/api/v1/common/client/download', { - invite_code: getAllQueryString('ic'), - platform: 'mac', -}).then((res: any) => { - downLoadMac.value = res.url -}) +// request.get('/api/v1/common/client/download', { +// invite_code: getAllQueryString('ic'), +// platform: 'mac', +// }).then((res: any) => { +// downLoadMac.value = res.url +// }) request.get('/api/v1/common/client/download', { invite_code: getAllQueryString('ic'), @@ -116,7 +116,7 @@ request.get('/api/v1/common/client/download', { const allDownloadOptions = computed(() => [ { key: 'win', mainIcon: Icon1, secondaryIcon: WinIcon, link: downLoadWin.value, label: 'Windows', id: 'downloadButton_win' }, - { key: 'mac', mainIcon: Icon3, secondaryIcon: MacIcon, link: downLoadMac.value, label: 'macOS', id: 'downloadButton_mac' }, + { key: 'mac', mainIcon: Icon3, secondaryIcon: MacIcon, label: 'macOS', id: 'downloadButton_mac' }, { key: 'ios', mainIcon: Icon2, secondaryIcon: AppleIcon, label: 'iOS', id: 'downloadButton_apple' }, { key: 'android', mainIcon: Icon4, secondaryIcon: AndroidIcon, label: 'Android', id: 'downloadButton_android' }, ]) diff --git a/src/utils/openinstall.ts b/src/utils/openinstall.ts index abc7030..4251780 100644 --- a/src/utils/openinstall.ts +++ b/src/utils/openinstall.ts @@ -41,6 +41,7 @@ class OpenInstallSdk { this.schemeWakeup()// 尝试使用scheme打开App(主要用于Android以及iOS的QQ环境中) const m = this const button = document.getElementById('downloadButton_apple') + const button_mac = document.getElementById('downloadButton_mac') const button1 = document.getElementById('downloadButton_android') const ic = getAllQueryString('ic') if (button) { @@ -53,6 +54,16 @@ class OpenInstallSdk { return false } } + if(button_mac) { + button_mac.onclick = function () { + if (ic) { + m.wakeupOrInstall({ data: { platform: 'download', inviteCode: ic } }) + } else { + m.wakeupOrInstall()// 此方法为scheme、Universal Link唤醒以及引导下载的作用(必须调用且不可额外自行跳转下载) + } + return false + } + } if (button1) { button1.onclick = function () { if (ic) {