Authored by qinchao

切换lb改为异步

... ... @@ -293,18 +293,44 @@ function nginxInitSwitch(cloudName) {
data: param ,
success: function (data) {
console.log(data);
if(data.code != 200){
if(data==null||data.code != 200){
layer.close(layerMirror);
alert(data.message);
alert("发生错误:"+data.message);
}else{
window.location.href = contextPath + "topoSwitch/toTopoSwitch";
//异步返回结果
var rtnID=data.data;
var count=0;
var intervalIndex = setInterval(function() {
$.ajax({
url: contextPath+"/topoSwitch/getLbSwitchResult",
type: "post",
dataType: "json",
data: {
rtnID:rtnID
},
success: function (checkResponse) {
count++;
if(count > 30){
clearInterval(intervalIndex);
window.location.href = contextPath + "topoSwitch/toTopoSwitch";
}else if(checkResponse!=null&&checkResponse.code==200){
clearInterval(intervalIndex);
window.location.href = contextPath + "topoSwitch/toTopoSwitch";;
}
},
error: function (e) {
console.log("getLbSwitchResult"+e);
}
});
}, 10000);
//window.location.href = contextPath + "topoSwitch/toTopoSwitch";
}
},
error: function (e) {
//alert("系统错误");
console.log(e);
layer.close(layerMirror);
alert("网络错误:异常"+e);
alert("网络错误:异常"+e.message);
window.location.href = contextPath + "topoSwitch/toTopoSwitch";
}
});
... ...