@zgfe/business-lib 1.2.23 → 1.2.24
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.js +22 -13
- package/package.json +2 -2
package/es/utils/ajax.js
CHANGED
|
@@ -106,7 +106,7 @@ function request(_x, _x2) {
|
|
|
106
106
|
}
|
|
107
107
|
function _request() {
|
|
108
108
|
_request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url, options) {
|
|
109
|
-
var _globalConfig$request, _globalConfig$request2, _params$options, _params$options2, err, option, list, optionsWrapper, responseWrapper, params, res;
|
|
109
|
+
var _globalConfig$request, _globalConfig$request2, _params$options, _params$options2, err, option, list, optionsWrapper, responseWrapper, params, res, _params$options3;
|
|
110
110
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
111
111
|
while (1) switch (_context.prev = _context.next) {
|
|
112
112
|
case 0:
|
|
@@ -150,39 +150,48 @@ function _request() {
|
|
|
150
150
|
throw new Error('Request Interruption');
|
|
151
151
|
case 17:
|
|
152
152
|
if (!(((_params$options2 = params.options) === null || _params$options2 === void 0 ? void 0 : _params$options2.responseType) === 'blob')) {
|
|
153
|
-
_context.next =
|
|
153
|
+
_context.next = 27;
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
156
|
if (!util.isBlob(res.data)) {
|
|
157
|
-
_context.next =
|
|
157
|
+
_context.next = 26;
|
|
158
158
|
break;
|
|
159
159
|
}
|
|
160
|
+
if (!(((_params$options3 = params.options) === null || _params$options3 === void 0 ? void 0 : _params$options3.downloadFile) === false)) {
|
|
161
|
+
_context.next = 23;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
return _context.abrupt("return", res.data);
|
|
165
|
+
case 23:
|
|
160
166
|
return _context.abrupt("return", downloadFile(res, params.options.fileName));
|
|
161
|
-
case
|
|
167
|
+
case 24:
|
|
168
|
+
_context.next = 27;
|
|
169
|
+
break;
|
|
170
|
+
case 26:
|
|
162
171
|
res = res.data;
|
|
163
|
-
case
|
|
172
|
+
case 27:
|
|
164
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));
|
|
165
|
-
case
|
|
166
|
-
_context.prev =
|
|
174
|
+
case 30:
|
|
175
|
+
_context.prev = 30;
|
|
167
176
|
_context.t0 = _context["catch"](0);
|
|
168
177
|
if (!_context.t0.isCancel) {
|
|
169
|
-
_context.next =
|
|
178
|
+
_context.next = 34;
|
|
170
179
|
break;
|
|
171
180
|
}
|
|
172
181
|
throw _context.t0;
|
|
173
|
-
case
|
|
182
|
+
case 34:
|
|
174
183
|
if (!(_context.t0.message === 'Request Interruption')) {
|
|
175
|
-
_context.next =
|
|
184
|
+
_context.next = 36;
|
|
176
185
|
break;
|
|
177
186
|
}
|
|
178
187
|
throw new Error('Request Interruption');
|
|
179
|
-
case
|
|
188
|
+
case 36:
|
|
180
189
|
return _context.abrupt("return", null);
|
|
181
|
-
case
|
|
190
|
+
case 37:
|
|
182
191
|
case "end":
|
|
183
192
|
return _context.stop();
|
|
184
193
|
}
|
|
185
|
-
}, _callee, null, [[0,
|
|
194
|
+
}, _callee, null, [[0, 30]]);
|
|
186
195
|
}));
|
|
187
196
|
return _request.apply(this, arguments);
|
|
188
197
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.24",
|
|
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": "c5c469154168cd30cf997ce8c6859c4323a2d8fc",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|