下载改安装

This commit is contained in:
WindowBird 2025-11-25 17:33:44 +08:00
parent bfbf6225f1
commit 864fae8d21

View File

@ -1,6 +1,6 @@
/**
* 应用版本更新工具类
* 支持版本检查和 APK 下载安装
* 支持版本检查和 APK 下载下载
*/
import { checkAppVersion } from '@/api/update'
@ -339,7 +339,7 @@ const installApk = (filePath) => {
},
() => {
uni.showToast({
title: '安装成功',
title: '下载成功',
icon: 'success'
})
// 安装成功后,延迟退出应用以便用户重启
@ -348,19 +348,19 @@ const installApk = (filePath) => {
}, 1500)
},
(error) => {
console.error('安装失败:', error)
console.error('下载失败:', error)
uni.showModal({
title: '安装失败',
content: '请检查是否允许安装未知来源应用,或手动安装下载的 APK 文件',
title: '下载失败',
content: '请检查是否允许下载未知来源应用,或手动下载下载的 APK 文件',
showCancel: false,
confirmText: '知道了'
})
}
)
} catch (error) {
console.error('安装 APK 异常:', error)
console.error('下载 APK 异常:', error)
uni.showToast({
title: '安装失败',
title: '下载失败',
icon: 'none'
})
}