@zgfe/business-lib 1.2.24 → 1.2.25
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/es/utils/ajax.d.ts +1 -1
- package/es/utils/ajax.js +3 -3
- package/package.json +2 -2
package/es/utils/ajax.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ajaxConfig, ApiResult, InterfaceApiResult } from './type';
|
|
2
|
-
export declare function responseErrorHandler<T>(url: string, apiResult: ApiResult<T>, errorTitle?: string, notifyType?: ajaxConfig<T>['notifyType']): ApiResult<T>;
|
|
2
|
+
export declare function responseErrorHandler<T>(url: string, apiResult: ApiResult<T>, errorTitle?: string, notifyType?: ajaxConfig<T>['notifyType'], intercept?: Boolean): ApiResult<T>;
|
|
3
3
|
declare function request<T>(url: string, options?: ajaxConfig<T>): Promise<InterfaceApiResult<T> | null>;
|
|
4
4
|
export default request;
|
package/es/utils/ajax.js
CHANGED
|
@@ -63,7 +63,7 @@ var downloadFile = function downloadFile(resData, name) {
|
|
|
63
63
|
a.click();
|
|
64
64
|
return null;
|
|
65
65
|
};
|
|
66
|
-
export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
66
|
+
export function responseErrorHandler(url, apiResult, errorTitle, notifyType, intercept) {
|
|
67
67
|
if (/\.jsp/.test(url)) {
|
|
68
68
|
return apiResult;
|
|
69
69
|
}
|
|
@@ -87,7 +87,7 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
87
87
|
message.error('账户没有权限');
|
|
88
88
|
flag = true;
|
|
89
89
|
}
|
|
90
|
-
if (!flag) {
|
|
90
|
+
if (!flag && intercept !== false) {
|
|
91
91
|
msg = apiResult.msg || msg;
|
|
92
92
|
notification[notifyType || 'error']({
|
|
93
93
|
message: errorTitle || "\u8BF7\u6C42\u9519\u8BEF",
|
|
@@ -170,7 +170,7 @@ function _request() {
|
|
|
170
170
|
case 26:
|
|
171
171
|
res = res.data;
|
|
172
172
|
case 27:
|
|
173
|
-
return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType));
|
|
173
|
+
return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType, options === null || options === void 0 ? void 0 : options.intercept)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType, options === null || options === void 0 ? void 0 : options.intercept));
|
|
174
174
|
case 30:
|
|
175
175
|
_context.prev = 30;
|
|
176
176
|
_context.t0 = _context["catch"](0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.25",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.12.0 || ^17.0.0",
|
|
56
56
|
"yorkie": "^2.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "84f2cbeebb1782f80edf955fb8e693fe9904e263",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|