diff --git a/controllers/ConfigController.php b/controllers/ConfigController.php index 0cdffb38..a7633497 100644 --- a/controllers/ConfigController.php +++ b/controllers/ConfigController.php @@ -297,7 +297,7 @@ class ConfigController extends Controller { ] ])), true); if (!$tempConfig['status']) - return ['status' => false, 'text' => '']; + return ['status' => false, 'text' => 'error']; if ($tempConfig['data'] === "") return ['status' => false, 'text' => 'Cấu hình ip chưa đúng!']; diff --git a/web/js/config.js b/web/js/config.js index 68d8af80..cf0e64bd 100644 --- a/web/js/config.js +++ b/web/js/config.js @@ -21,6 +21,7 @@ function saveStep1(e) { url: url }, success: function (data) { + var c = 0; setInterval(function () { $.ajax({ url: data, @@ -30,8 +31,16 @@ function saveStep1(e) { window.location = data.url; } else { if (data.text !== "") { - alert(data.text); - window.location.reload(true); + if (data.text === "error") { + c++; + if (c == 5) { + alert("Box chưa được đăng kí trên CMS!"); + window.location.reload(true); + } + } else { + alert(data.text); + window.location.reload(true); + } } } },