appInit.js 552 字节
Newer Older
芊里 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
export default function (){
	
	// 初始化appVersion
	initAppVersion();
	
	// 检查更新
	checkUpdate();
}

function initAppVersion(){
	let appid = plus.runtime.appid;
	plus.runtime.getProperty(appid ,(wgtInfo) => {
		 wgtInfo.version 
		 let appVersion = plus.runtime;
		 getApp({allowDefault: true}).appVersion = {
			 appid,
			 version:appVersion,
			 wgtVersion:wgtInfo,
			 finall:appVersion.versionCode > wgtInfo.versionCode ? appVersion : wgtInfo
		 }
	});
}