From 56b3ecfd2582500a196486fd5def2c06cd9a28d2 Mon Sep 17 00:00:00 2001 From: alger Date: Thu, 15 May 2025 22:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=BD=91=E9=A1=B5=E7=AB=AF=E4=B8=8B=E8=BD=BD=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/en-US/comp.ts | 2 +- src/i18n/lang/zh-CN/comp.ts | 2 +- .../components/common/InstallAppModal.vue | 57 +------------------ 3 files changed, 5 insertions(+), 56 deletions(-) diff --git a/src/i18n/lang/en-US/comp.ts b/src/i18n/lang/en-US/comp.ts index 27b6b4f..1d5981e 100644 --- a/src/i18n/lang/en-US/comp.ts +++ b/src/i18n/lang/en-US/comp.ts @@ -1,6 +1,6 @@ export default { installApp: { - description: 'Install the application on the desktop for a better experience', + description: 'Install the application for a better experience', noPrompt: 'Do not prompt again', install: 'Install now', cancel: 'Cancel', diff --git a/src/i18n/lang/zh-CN/comp.ts b/src/i18n/lang/zh-CN/comp.ts index 25a3f19..3d12294 100644 --- a/src/i18n/lang/zh-CN/comp.ts +++ b/src/i18n/lang/zh-CN/comp.ts @@ -1,6 +1,6 @@ export default { installApp: { - description: '在桌面安装应用,获得更好的体验', + description: '安装应用程序,获得更好的体验', noPrompt: '不再提示', install: '立即安装', cancel: '暂不安装', diff --git a/src/renderer/components/common/InstallAppModal.vue b/src/renderer/components/common/InstallAppModal.vue index a9ad8eb..fe9b2eb 100644 --- a/src/renderer/components/common/InstallAppModal.vue +++ b/src/renderer/components/common/InstallAppModal.vue @@ -45,8 +45,7 @@ import { onMounted, ref } from 'vue'; import { useI18n } from 'vue-i18n'; -import { isElectron, isMobile } from '@/utils'; -import { getLatestReleaseInfo, getProxyNodes } from '@/utils/update'; +import { isElectron } from '@/utils'; import config from '../../../../package.json'; @@ -54,7 +53,6 @@ const { t } = useI18n(); const showModal = ref(false); const noPrompt = ref(false); -const releaseInfo = ref(null); const closeModal = () => { showModal.value = false; @@ -63,11 +61,9 @@ const closeModal = () => { } }; -const proxyHosts = ref([]); - onMounted(async () => { // 如果是 electron 环境,不显示安装提示 - if (isElectron || isMobile.value) { + if (isElectron) { return; } @@ -76,58 +72,11 @@ onMounted(async () => { if (isDismissed) { return; } - - // 获取最新版本信息 - releaseInfo.value = await getLatestReleaseInfo(); showModal.value = true; - proxyHosts.value = await getProxyNodes(); }); const handleInstall = async (): Promise => { - const assets = releaseInfo.value?.assets || []; - const { userAgent } = navigator; - const isMac = userAgent.toLowerCase().includes('mac'); - const isWindows = userAgent.toLowerCase().includes('win'); - const isLinux = userAgent.toLowerCase().includes('linux'); - const isX64 = - userAgent.includes('x86_64') || userAgent.includes('Win64') || userAgent.includes('WOW64'); - - let downloadUrl = ''; - - // 根据平台和架构选择对应的安装包 - if (isMac) { - // macOS - const macAsset = assets.find((asset) => asset.name.includes('mac')); - downloadUrl = macAsset?.browser_download_url || ''; - } else if (isWindows) { - // Windows - let winAsset = assets.find( - (asset) => - asset.name.includes('win') && - (isX64 ? asset.name.includes('x64') : asset.name.includes('ia32')) - ); - if (!winAsset) { - winAsset = assets.find((asset) => asset.name.includes('win.exe')); - } - downloadUrl = winAsset?.browser_download_url || ''; - } else if (isLinux) { - // Linux - const linuxAsset = assets.find( - (asset) => - (asset.name.endsWith('.AppImage') || asset.name.endsWith('.deb')) && - asset.name.includes('x64') - ); - downloadUrl = linuxAsset?.browser_download_url || ''; - } - - if (downloadUrl) { - const proxyDownloadUrl = `${proxyHosts.value[0]}/${downloadUrl}`; - window.open(proxyDownloadUrl, '_blank'); - } else { - // 如果没有找到对应的安装包,跳转到 release 页面 - window.open('https://github.com/algerkong/AlgerMusicPlayer/releases/latest', '_blank'); - } - closeModal(); + window.open('http://donate.alger.fun/download', '_blank'); };