Hbuilder X 版本更新 (热更资源以及安装APK)
先看下我的服务器配置文件: 是个txt 的JSon 文件
之所以这么配置 是应为 有时候 需要版本共存的缘故, 比方说提审等等
服务器用的 IIS 的 .因为有 .wgt 和 .apk 文件大家记得 自己添加
Index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<script src="js/vconsole.min.js"></script>
<script src="updateVersion.js"></script>
<script src="mui/js/mui.min.js"></script>
<script>
var vConsole = new VConsole()
function plusReady() {
//console.log("所有plus api都应该在此事件发生后调用,否则会出现plus is undefined。"
//App 运行此代码会执行..
doMain()
}
if (window.plus) {
plusReady();
} else {
document.addEventListener('plusready', plusReady, false);
}
</script>
</head>
<body>
<img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1551882959046&di=3ec5062d3def03766bc394a16dfc53ff&imgtype=0&src=http%3A%2F%2Fsm.pcmag.com%2Ft%2Fpcmag_ap%2Fgallery%2Fb%2Fbitdefende%2Fbitdefender-antivirus-plus_2qmg.1080.jpg" />
</body>
</html>
index.html 中要这么写,才能在 App中( H5+ ) 的环境中 被调用
function plusReady() {
//console.log("所有plus api都应该在此事件发生后调用,否则会出现plus is undefined。"
//App 运行此代码会执行..
doMain()
}
if (window.plus) {
plusReady();
} else {
document.addEventListener('plusready', plusReady, false);
}
需要提前制作好 .wgt 文件放在服务器上
引入 然后 updateVersion.js 文件
工程文件下载地址:https://download.csdn.net/download/nicepainkiller/11005117