瀏覽代碼

表格树添加获取数据后响应回调处理

RuoYi 5 年之前
父節點
當前提交
82f8dadbae
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7 4
      ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

+ 7 - 4
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -562,12 +562,15 @@ var table = {
             	return $.common.uniqueFn(rows);
             },
             // 请求获取数据后处理回调函数,校验异常状态提醒
-            responseHandler: function(data) {
-            	if (data.code != undefined && data.code != 0) {
-            		$.modal.alertWarning(data.msg);
+            responseHandler: function(res) {
+            	if (typeof table.options.responseHandler == "function") {
+            		table.options.responseHandler(res);
+                }
+            	if (res.code != undefined && res.code != 0) {
+            		$.modal.alertWarning(res.msg);
             		return [];
                 } else {
-                    return data;
+                    return res;
                 }
             },
         },