From 4b1ade55b8cf4e2cdbf872205ccc3c97a5c2071d Mon Sep 17 00:00:00 2001 From: todaywindy Date: Tue, 17 Jun 2025 17:11:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=AE=A2=E5=8D=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Order.php | 4 ++-- public/assets/js/backend/index.js | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index be2967e..e4a430b 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -634,8 +634,8 @@ class Order extends Backend $op[] = ['id' => $option->id, 'title' => $option->title]; } $order = model('order')->get($ids); - if ($order){ - $this->error('订单未找到,请重试'); + if (!$order){ + $this->error('Not Find'); } return $this->fetch('delete', ['row' => $order, 'options' => $op]); } diff --git a/public/assets/js/backend/index.js b/public/assets/js/backend/index.js index ce92d77..27e8e4d 100755 --- a/public/assets/js/backend/index.js +++ b/public/assets/js/backend/index.js @@ -445,18 +445,23 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi },60*1000); - var s =5;//几秒刷新 - setInterval(f5,s*1000); - //定时器刷新 + var s = 30; + function f5() { - $.post("/admin/ajax/get_config?",{field:'addr2'},function(data,status){ - // alert("Data: " + data.data + "nStatus: " + status); - // console.log(data); - Backend.api.sidebar(JSON.parse(data)); - + $.post("/admin/ajax/get_config?", { field: 'addr2' }, function (data, status) { + try { + Backend.api.sidebar(JSON.parse(data)); + } catch (e) { + console.error("解析失败", e); + } + }).always(function () { + // 无论成功失败,延迟下一次 + setTimeout(f5, s * 1000); }); - } + f5(); // 初始化执行 + + return Controller; });