diff --git a/common/appUpdate/index.js b/common/appUpdate/index.js index bc3fe91..1fe296b 100644 --- a/common/appUpdate/index.js +++ b/common/appUpdate/index.js @@ -16,7 +16,7 @@ export const getCurrentAppInfo = ()=> { console.log('widgetInfo=========', widgetInfo); widgetInfo._appVersion = `${widgetInfo.version}.${widgetInfo.versionCode}` resolve(widgetInfo) - }); + }); // #endif }) } @@ -93,7 +93,7 @@ const compareInfo = (curAppInfo, lastAppInfo)=> { url = lastAppInfo.wgtUrl } // 判断是否走白名单更新 - if(lastAppInfo.whiteDeviceIds?.length > 0) { + if(url && lastAppInfo.whiteDeviceIds?.length > 0) { let sysInfo = getSystemInfo() hasNewVersion = lastAppInfo.whiteDeviceIds.indexOf(sysInfo?.deviceId) > -1 } @@ -110,7 +110,7 @@ export const checkUpdate = async ()=> { let lastAppInfo = await getLastAppInfo(curAppInfo) let cmpRes = await compareInfo(curAppInfo, lastAppInfo) console.log("checkUpdate cmpRes ====", cmpRes) - if(cmpRes.hasNewVersion) { + if(cmpRes.hasNewVersion && cmpRes.url) { let fmBl = await confirmModal(`app最新版本:${cmpRes.lastAppInfo.version}.${cmpRes.lastAppInfo.versionCode}, 是否更新?`) if(fmBl) { await installNewApk(cmpRes.url)