diff --git a/www/js/beauty.js b/www/js/beauty.js index 01227f2..5942917 100644 --- a/www/js/beauty.js +++ b/www/js/beauty.js @@ -926,6 +926,7 @@ $('.expand-icon').click(function(evt) { /* MainBot扫描进度展示 */ if ($('.botstats').length > 0) { + var didScan = false; var refreshBotStats = function() { $.ajax({ url: '/site/botstats', @@ -942,16 +943,18 @@ if ($('.botstats').length > 0) { $('.botstats .progress-bar').text(data.percent + '%'); } if (data.percent < 100) { + didScan = true; $('.btnStartScan').prop('disabled', true); $('.botstats').removeClass('hide'); $('.botstats .progress-bar').removeClass('progress-bar-success'); setTimeout(refreshBotStats, 10000); - }else { + }else if (didScan) { $('.botstats .progress-bar').addClass('progress-bar-success'); setTimeout(function() { $('.botstats').addClass('hide'); $('.btnStartScan').removeAttr('disabled'); - }, 3000); + location.reload(); + }, 4000); } } }).fail(function(jqXHR, textStatus, errorThrown) {