From 6b653400ad0cb0b8a33f68e648e611b83466a015 Mon Sep 17 00:00:00 2001 From: "Zhenfei.Li" Date: Mon, 19 Oct 2020 16:43:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/com/fr/plugin/pack/req.js | 30 +++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/main/resources/com/fr/plugin/pack/req.js b/src/main/resources/com/fr/plugin/pack/req.js index 9f1bae4..4c0377e 100644 --- a/src/main/resources/com/fr/plugin/pack/req.js +++ b/src/main/resources/com/fr/plugin/pack/req.js @@ -10,18 +10,26 @@ // 防抖机制,0.3s无新的data请求,才向后端发送。否则会先打包并等待0.3s var requestFunc = BI.debounce(function () { - BI.reqPost("plugin/design/widgets/data", { - widgets: widgets - }, function (res) { - BI.each(handlers, function (wId, handler) { - handler.resolve({ - config: config, - status: 200, - statusText: "success", - headers: {"content-type": "application/json;charset=UTF-8"}, - response: BI.jsonEncode(res.data[wId]) + BI.asyncAjax({ + url: "widgets/data", + type: "POST", + data: { + widgets: widgets + }, + success: function (res) { + BI.each(handlers, function (wId, handler) { + handler.resolve({ + config: config, + status: 200, + statusText: "success", + headers: {"content-type": "application/json;charset=UTF-8"}, + response: BI.jsonEncode(res.data[wId]) + }); }); - }); + }, + complete: BI.emptyFn, + opt: {}, + version: "url" }); widgets = {}; handlers = {};