From 1868b75328253db4e7d0266645061e09039662b6 Mon Sep 17 00:00:00 2001 From: augushong Date: Sun, 27 Apr 2025 10:34:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89form=E5=9B=9E=E8=B0=83=E6=97=B6?= =?UTF-8?q?=E6=9C=AA=E6=89=A7=E8=A1=8C=E7=BB=88=E6=AD=A2=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF=E6=97=B6?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E8=AF=B7=E6=B1=82=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/plugs/ulthon-admin/ulthon-admin.js | 72 ++++++++++++------- 1 file changed, 48 insertions(+), 24 deletions(-) diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js index d2c4d02..b534615 100644 --- a/public/static/plugs/ulthon-admin/ulthon-admin.js +++ b/public/static/plugs/ulthon-admin/ulthon-admin.js @@ -144,15 +144,32 @@ }; complete = complete || function () { }; - no = no || function (res) { - var msg = res.msg == undefined ? '返回数据格式有误' : res.msg; - admin.msg.error(msg); - complete(); - return false; - }; - ex = ex || function (res) { - complete(); - }; + if(no){ + var originalNo = no; + no = function (res) { + originalNo(res); + complete(); + } + }else{ + no = function (res) { + var msg = res.msg == undefined ? '返回数据格式有误' : res.msg; + admin.msg.error(msg); + complete(); + return false; + } + } + + if(ex){ + var originalEx = ex; + ex = function (res) { + originalEx(res); + complete(); + } + }else{ + ex = function (res) { + complete(); + }; + } if (option.url == '') { admin.msg.error('请求地址不能为空'); return false; @@ -2250,21 +2267,28 @@ refreshTable = true; } - ok = ok || function (res) { - res.msg = res.msg || ''; - admin.msg.success(res.msg, function () { - - if (close) { - admin.api.closeCurrentOpen({ - refreshTable: refreshTable, - onClose: function () { - complete(); - } - }); - } - }); - return false; - }; + if(ok){ + var originalOk = ok; + ok = function (res) { + originalOk(res); + complete() + } + }else{ + ok = function (res) { + res.msg = res.msg || ''; + admin.msg.success(res.msg, function () { + if (close) { + admin.api.closeCurrentOpen({ + refreshTable: refreshTable, + onClose: function () { + complete(); + } + }); + } + }); + return false; + }; + } admin.request.post({ url: url, data: data,