|
@@ -257,18 +257,18 @@ $(document).ready(function() {
|
|
|
var checkDownloadStatus = function() {
|
|
|
var intervalId = setInterval(function() {
|
|
|
console.log('checkDownloadStatus ....');
|
|
|
- // $.ajax({
|
|
|
- // url: '/download-status',
|
|
|
- // method: 'GET',
|
|
|
- // dataType: 'json',
|
|
|
- // success: function(response) {
|
|
|
- // console.log(response);
|
|
|
- // if (response.status == 0 || response.status == 2) {
|
|
|
- // clearInterval(intervalId);
|
|
|
- // layer.close(loadIndex); // 关闭加载层
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
+ $.ajax({
|
|
|
+ url: '/download-status',
|
|
|
+ method: 'GET',
|
|
|
+ dataType: 'json',
|
|
|
+ success: function(response) {
|
|
|
+ console.log(response);
|
|
|
+ if (response.status == 0 || response.status == 2) {
|
|
|
+ clearInterval(intervalId);
|
|
|
+ layer.close(loadIndex); // 关闭加载层
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}, 1000); // 每秒请求一次
|
|
|
}
|
|
|
|
|
@@ -459,7 +459,7 @@ $(document).ready(function() {
|
|
|
method: 'GET',
|
|
|
dataType: 'json',
|
|
|
success: function(response) {
|
|
|
- if (response.status == 0) {
|
|
|
+ if (response.status == 0 || response.status == 2) {
|
|
|
downdHref();
|
|
|
checkDownloadStatus();
|
|
|
}
|