【报Bug】更新版本后ios异步无法返回
unicodes
- 发布:2019-09-24 01:01
- 更新:2019-09-24 02:02
- 阅读:660
【报Bug】更新版本后ios异步无法返回
分类:HBuilderX
/*更新检测*/
var updateUrl = "http://127.0.0.1/update.json"
function updateCheck(){
//plus.nativeUI.showWaiting("检测更新...");
var xhr=new XMLHttpRequest();
xhr.onreadystatechange=function(){
switch(xhr.readyState){
case 4:
plus.nativeUI.closeWaiting();
if(xhr.status==200){
//console.log("检测更新成功:"+xhr.responseText);
var newVer=eval('(' + xhr.responseText + ')');
if(version_validate!=newVer.validate){
updateDownload(newVer.update); // 下载升级包
//plus.nativeUI.alert("发现更新!");
//console.log("发现更新");
}else{
//console.log("无新版本可更新");
//plus.nativeUI.alert("无新版本可更新!");
}
}else{
//console.log("检测更新失败!");
plus.nativeUI.alert("检测更新失败,请检查网络连接!");
}
break;
default:
break;
}
}
xhr.open('GET',updateUrl);
xhr.send();
}
我的情况是这样的,请求失败,输出后发现 updateUrl 变量的地址设置的是http://127.0.0.1/update.json 变成了 tp://127.0.0.1/update.json
coffey
我这边也是这个情况,发现异步请求时,原来变量设置的 http://xxxxx的地址,在新版里面读到的变量请求地址变成了 tp://xxxxx 了
2019-09-24 01:58
coffey
切换到上一个版本以后就都正常了。
2019-09-24 01:59