feat: 版本更新优化非强制更新
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user