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

View File

@ -93,7 +93,7 @@ const compareInfo = (curAppInfo, lastAppInfo)=> {
url = lastAppInfo.wgtUrl url = lastAppInfo.wgtUrl
} }
// 判断是否走白名单更新 // 判断是否走白名单更新
if(lastAppInfo.whiteDeviceIds?.length > 0) { if(url && lastAppInfo.whiteDeviceIds?.length > 0) {
let sysInfo = getSystemInfo() let sysInfo = getSystemInfo()
hasNewVersion = lastAppInfo.whiteDeviceIds.indexOf(sysInfo?.deviceId) > -1 hasNewVersion = lastAppInfo.whiteDeviceIds.indexOf(sysInfo?.deviceId) > -1
} }
@ -110,7 +110,7 @@ export const checkUpdate = async ()=> {
let lastAppInfo = await getLastAppInfo(curAppInfo) let lastAppInfo = await getLastAppInfo(curAppInfo)
let cmpRes = await compareInfo(curAppInfo, lastAppInfo) let cmpRes = await compareInfo(curAppInfo, lastAppInfo)
console.log("checkUpdate cmpRes ====", cmpRes) console.log("checkUpdate cmpRes ====", cmpRes)
if(cmpRes.hasNewVersion) { if(cmpRes.hasNewVersion && cmpRes.url) {
let fmBl = await confirmModal(`app最新版本:${cmpRes.lastAppInfo.version}.${cmpRes.lastAppInfo.versionCode}, 是否更新?`) let fmBl = await confirmModal(`app最新版本:${cmpRes.lastAppInfo.version}.${cmpRes.lastAppInfo.versionCode}, 是否更新?`)
if(fmBl) { if(fmBl) {
await installNewApk(cmpRes.url) await installNewApk(cmpRes.url)