xinyb
2024-09-19 18ffbca9acaccd5099a7a63652f52210f59a7e40
提交 | 用户 | age
a6a76f 1 var Ip="";
F 2 var port="";
3 var clientVersion="";
4 var clientPath="";
5 var para="";
6 var fileName="";
7 var a="<table>";
8 var budingIsPush = active;//是否推送
9 $(function(){
10
11         $.post("/getRealUrl.do",function(data){//获取客户端autoupdate.xml中的信息
12             clientVersion=data.clientVersion;
13             Ip=data.Ip;
14             port=data.port;
15             clientPath=data.clientPath;
16             keyId=data.keyId;
17             //var cltcode="001";
18             //var updateHistory="";
19             //使用jsonp跨域     判断是否需要更新并下载到客户端
20             $.post("http://"+Ip+":"+port+"/updateInfo.do?callback=?",{clientVersion:clientVersion,keyId:keyId,isPush:budingIsPush},function(data){
21                 if(typeof(data.status)!="undefined"){
22                     if(data.value=="isnew"){
23                         $("#top").hide();
24                         $("#update").hide();
25                         $("#loading").hide();
26                         $("#Info").html(data.status);
27                     }
28                     if(data.value=="isupdate"){
29                         $("#loading").hide();
30                         $("#update").hide();
31                         for ( var int = 0; int < data.status.length; int++) {
32                              a += "<tr style='font-weight: bold'><td >"+data.status[int].versionNum+"</td></tr>";
33                              a += "<tr><td>"+data.status[int].remarks+"</td></tr>";
34                              fileName+=data.status[int].fileName+",";
35                              $("#update").show();
36                         }
37                         a+="</table>";
38                         $("#Info").html(a);
39                     }
40                 }                
41             },"json");
42         },"json");
43 })
44
45
46 function update(){
47     $("#loading").show();
48     //$.post("/downloadPackge.do",{fileName:fileName});
49     $.post("/versionUpdate.do",{para:fileName,isPush:budingIsPush},function(data){//更新包的解压
50         $("#update").hide();
51         $("#top").hide();
52         $("#loading").hide();
53         $("#Info").html(data.status);
54         if(data.createForm=="all"){
55             location.href='/buildv2.do?m=a';
56         }
57         if(data.createForm!="" && data.createForm!=undefined){
58             location.href='/buildv2.do?m=a&list='+data.createForm;
59         }
60     },"json")
61 }
62
63 ////确定更新
64 //function update(){
65 //    $.post("http://"+Ip+":"+port+"/update.do?callback=?",{clientVersion:clientVersion,path:clientPath},function(data){
66 //        para = data.version;
67 //        $.post("/versionUpdate.do",{para:para},function(data){//更新包的解压
68 //            $("#update").hide();
69 //            $("#top").hide();
70 //            $("#Info").html(data.status);
71 //        },"json")
72 //    },"json");
73 //}
74
75 function canel(){
76     parent.deskTopHidden();
77
78 }