|
|
@@ -152,7 +152,6 @@ export default {
|
|
|
plus.screen.lockOrientation("portrait-primary"); //竖屏正方向锁定
|
|
|
//获取是否热更新过
|
|
|
const updated = uni.getStorageSync("updated"); // 尝试读取storage
|
|
|
-
|
|
|
if (updated.completed === true) {
|
|
|
// 如果上次刚更新过
|
|
|
// 删除安装包及安装记录
|
|
|
@@ -164,6 +163,7 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
} else if (updated.completed === false) {
|
|
|
+ console.log('安装未完成,继续安装')
|
|
|
uni.removeStorageSync("updated");
|
|
|
plus.runtime.install(updated.packgePath, {
|
|
|
force: true,
|
|
|
@@ -187,12 +187,15 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
} else {
|
|
|
+ console.log('获取当前系统版本信息')
|
|
|
//获取当前系统版本信息
|
|
|
plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
|
|
|
//请求后台接口 解析数据 对比版本
|
|
|
that.$Request.getT("/app/user/selectNewApp").then((res) => {
|
|
|
res = res.data[0];
|
|
|
+ console.log('当前版本:',widgetInfo.version+'线上版本:'+res.version)
|
|
|
if (res.wgtUrl && widgetInfo.version < res.version) {
|
|
|
+ console.log('进入更新逻辑')
|
|
|
let downloadLink = "";
|
|
|
let androidLink = res.androidWgtUrl;
|
|
|
let iosLink = res.iosWgtUrl;
|