feat: 版本更新优化非强制更新

This commit is contained in:
2026-06-03 10:20:56 +08:00
parent 0be8c98710
commit 55ce8b83eb
5 changed files with 885 additions and 70 deletions
+8 -3
View File
@@ -84,14 +84,19 @@ const pay = (payment, orderType, orderSN) => {
* 检查更新 (只检查小程序和App)
* @param {Boolean} silence - 静默检查
*/
const checkUpdate = (silence = false) => {
let canUpdate;
const checkUpdate = async (silence = false) => {
// #ifdef MP-WEIXIN
useProvider().checkUpdate(silence);
// #endif
// #ifdef APP-PLUS
// TODO: 热更新
if (typeof uni !== 'undefined' && typeof uni.__globalHotUpdateCheck === 'function') {
await uni.__globalHotUpdateCheck({ force: true, source: 'platform', silence: !!silence })
return
}
if (!silence) {
uni.showToast({ title: '当前环境不支持更新', icon: 'none' })
}
// #endif
};