剪切板 mac前去下载

This commit is contained in:
2026-03-13 18:01:38 +08:00
parent 44df456240
commit 7e3b7448fa

View File

@@ -76,14 +76,17 @@
<p class="text-gray-600 text-sm whitespace-pre-wrap">{{ updateInfo.releaseNotes }}</p>
</div>
<!-- Mac 用户跳转下载页面 -->
<!-- Mac 用户复制下载链接 -->
<template v-if="isMac">
<p class="text-amber-600 text-sm bg-amber-50 p-3 rounded-lg text-center">
Mac 版本请前往官网下载最新安装包
Mac 版本请复制下方链接在浏览器中打开下载最新安装包
</p>
<button @click="openDownloadPage"
<div class="bg-gray-50 rounded-lg p-3 text-center">
<span class="text-blue-600 text-sm break-all select-all">{{ downloadUrl }}</span>
</div>
<button @click="copyDownloadUrl"
class="w-full py-3 bg-gradient-to-r from-blue-600 to-blue-500 text-white rounded-lg font-medium hover:from-blue-700 hover:to-blue-600 transition-all shadow-sm">
前往下载
{{ copySuccess ? '已复制' : '复制链接' }}
</button>
</template>
@@ -212,6 +215,8 @@ const retryCount = ref(0)
const isTimeout = ref(false)
const showTimeoutError = ref(false)
const countdown = ref(AUTO_INSTALL_DELAY)
const downloadUrl = 'https://yolozs.com/'
const copySuccess = ref(false)
let timeoutTimer = null
let hasStarted = false
@@ -319,13 +324,12 @@ function formatBytes(bytes) {
return `${(bytes / Math.pow(k, i)).toFixed(1)} ${sizes[i]}`
}
// 打开下载页面Mac 用户)
function openDownloadPage() {
if (isElectronEnv) {
window.electronAPI.openExternal?.('https://yolozs.com/')
} else {
window.open('https://yolozs.com/', '_blank')
}
// 复制下载链接Mac 用户)
function copyDownloadUrl() {
navigator.clipboard.writeText(downloadUrl).then(() => {
copySuccess.value = true
setTimeout(() => { copySuccess.value = false }, 2000)
})
}
onUnmounted(() => {