@hzab/list-render 1.10.17 → 1.10.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/list-render.jsx +4 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/list-render.jsx
CHANGED
|
@@ -5,7 +5,7 @@ model 不要定义在组件外部,避免出现 query 异常的情况。
|
|
|
5
5
|
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
6
6
|
import { Button, message } from "antd";
|
|
7
7
|
import _, { cloneDeep } from "lodash";
|
|
8
|
-
import
|
|
8
|
+
import axiosI, { isCancel, getCancelTokenSource } from "@hzab/data-model/src/axios";
|
|
9
9
|
|
|
10
10
|
import QueryRender from "./query-render";
|
|
11
11
|
import Pagination from "./pagination-render";
|
|
@@ -195,7 +195,9 @@ const ListRender = forwardRef(function (props, parentRef) {
|
|
|
195
195
|
setListLoading(false);
|
|
196
196
|
})
|
|
197
197
|
.catch((err) => {
|
|
198
|
-
|
|
198
|
+
// 兼容新老版本 data-model isCancel 取法
|
|
199
|
+
const _isCancel = isCancel || axiosI.isCancel;
|
|
200
|
+
if (typeof _isCancel === "function" && _isCancel(err)) {
|
|
199
201
|
console.info(`请求已取消:`, "", err.message);
|
|
200
202
|
return Promise.reject(err);
|
|
201
203
|
}
|