Browse Source

feat: 修改请求的url

pull/1/head
Zhenfei.Li 4 years ago
parent
commit
6b653400ad
  1. 30
      src/main/resources/com/fr/plugin/pack/req.js

30
src/main/resources/com/fr/plugin/pack/req.js

@ -10,18 +10,26 @@
// 防抖机制,0.3s无新的data请求,才向后端发送。否则会先打包并等待0.3s // 防抖机制,0.3s无新的data请求,才向后端发送。否则会先打包并等待0.3s
var requestFunc = BI.debounce(function () { var requestFunc = BI.debounce(function () {
BI.reqPost("plugin/design/widgets/data", { BI.asyncAjax({
widgets: widgets url: "widgets/data",
}, function (res) { type: "POST",
BI.each(handlers, function (wId, handler) { data: {
handler.resolve({ widgets: widgets
config: config, },
status: 200, success: function (res) {
statusText: "success", BI.each(handlers, function (wId, handler) {
headers: {"content-type": "application/json;charset=UTF-8"}, handler.resolve({
response: BI.jsonEncode(res.data[wId]) 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 = {}; widgets = {};
handlers = {}; handlers = {};

Loading…
Cancel
Save