This commit is contained in:
aihe 2024-06-16 12:50:00 +08:00
parent 0d383fbe55
commit 258e181944

View File

@ -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)