HTML5进阶(三)HBuilder实现软件自动升级(优化篇)_hbuilder标签优化

最后

开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

给大家分享一些关于HTML的面试题。


wgtVer = inf.version;
localStorage.setItem(‘newVer’, wgtVer);
console.log(localStorage.getItem(‘newVer’));
console.log(“当前应用版本:” + wgtVer);
/alert( "国际移动设备身份码IMEI: " + plus.device.imei );
alert( "国际移动用户识别码IMSI: " + plus.device.imsi );
alert( "设备唯一标识号uuid: "+plus.device.uuid );
/
console.log(“=版本测试=”);
var version = {
‘version’: wgtVer
};
appCallServer(KaTeX parse error: Expected '}', got 'EOF' at end of input: …tion(data) { /*ionicLoading.show({
template: ‘测试’
});
$timeout(function() {
$ionicLoading.hide();
}, 1200);*/
});
});
}
if(window.plus){
plusReady();
}else{
document.addEventListener(‘plusready’,plusReady,false);
}
// 下载新版本
function downWgt(newVer, wgtUrl){
plus.nativeUI.showWaiting(“下载wgt文件…”);
plus.downloader.createDownload( wgtUrl, {filename:“_doc/update/”}, function(d,status){
if ( status == 200 ) {
console.log(“下载wgt成功:”+d.filename);
installWgt(d.filename,newVer);// 安装wgt包
} else {
console.log(“下载wgt失败!”);
plus.nativeUI.alert(“下载wgt失败!”);
}
plus.nativeUI.closeWaiting();
}).start();
}
// 更新应用资源
function installWgt(path,newVer){
plus.nativeUI.showWaiting(“安装wgt文件…”);
// force:false进行版本号校验,如果将要安装应用的版本号不高于现有应用的版本号则终止安装,并返回安装失败
plus.runtime.install(path,{force:false},function(){
plus.nativeUI.closeWaiting();
console.log(“安装wgt文件成功!”);
localStorage.setItem(‘newVer’, newVer);
// H5 plus事件处理,弹出提示信息对话框
plus.nativeUI.confirm(“应用资源更新完成,是否重新打开应用?”, function(e) {
if (e.index == 0) {
console.log(“确定重新打开应用!”);
plus.runtime.restart();
}
}, " 立马送药", [“确定”, “取消”]);
},function(e){
plus.nativeUI.closeWaiting();
console.log(“安装wgt文件失败[” + e.code + “]:” + e.message);
plus.nativeUI.alert(“安装wgt文件失败[” + e.code + “]:” + e.message);
});
}


 


### 服务端源码(拿走不谢)


 



// check version
public static boolean do_9104(RequestMessage request,ResponseMessage response) {

logger.info(“\n\n------------Check_APP_Version_9104 debug info-------------\n请求数据包信息:” + request.json.toString());
String version = request.getString(“version”).trim();
String currentVersion = FileUtil.readFile(MyConst.VERSION_FILE_PATH).replaceAll(“null”,“”).trim();
logger.info(“当前APP版本:[” + currentVersion + “]”);
if(!version.isEmpty() && !currentVersion.isEmpty() && (!version.equals(currentVersion))){
response.json.element(“newVersion”, currentVersion); // 返回最新版本
response.json.element(“url”, MyConst.WGT_URL + currentVersion + “.wgt”); // 返回wgt文件下载地址
}else if(!version.isEmpty() && !currentVersion.isEmpty() && (version.equals(currentVersion))){
response.result = MyConst.ERR_VERSION_SAME;
response.errtext = “当前已是最新版本”;
}else{
response.result = MyConst.ERR_VERSION;
response.errtext = “版本信息查询失败”;
return (false);
}
return true;

最后

小编综合了阿里的面试题做了一份前端面试题PDF文档,里面有面试题的详细解析

开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

虽只说了一个公司的面试,但我们可以知道大厂关注的东西并举一反三,通过一个知识点延伸到另一个知识点,这是我们要掌握的学习方法,小伙伴们在这篇有学到的请评论点赞转发告诉小编哦,谢谢大家的支持!

==,size_16,color_FFFFFF,t_70)

虽只说了一个公司的面试,但我们可以知道大厂关注的东西并举一反三,通过一个知识点延伸到另一个知识点,这是我们要掌握的学习方法,小伙伴们在这篇有学到的请评论点赞转发告诉小编哦,谢谢大家的支持!

  • 30
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值