Browse Source

bug修复

chenrui 3 năm trước cách đây
mục cha
commit
505f4920bc
1 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 7 3
      libs/tools.js

+ 7 - 3
libs/tools.js

@@ -253,9 +253,13 @@ export const checkVersionToLoadUpdate = function(newVersion,type,callback){
 	}
 	const curVer = getApp().globalData.version  // 当前版本信息
 	console.log(newVersion,curVer,callback)
-	const curr_version = curVer.version.replace(/\./g,'')
-	const server_version = newVersion.version // 最新版本信息
-	const isQzgx = newVersion.forceUpgrade != 1
+	if(!newVersion || !curVer){
+		callback()
+		return
+	}
+	const curr_version = curVer && curVer.version ? curVer.version.replace(/\./g,'') : ''
+	const server_version = newVersion && newVersion.version ? newVersion.version : '' // 最新版本信息
+	const isQzgx = newVersion && newVersion.forceUpgrade != 1
 	let isWifi = plus.networkinfo.getCurrentType()!=3 ? '有新的版本发布,检测到您目前非Wifi连接,' : '有新的版本发布,'
 	let msg = isWifi + (!isQzgx ? '请立即更新?' : '是否立即更新版本?')
 	// 下载app并安装