@freelog/tools-lib 0.1.64 → 0.1.65
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/dist/tools-lib.cjs.development.js +30 -62
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +30 -62
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/axios.d.ts +3 -0
- package/package.json +1 -1
- package/src/service-API/nodes.ts +65 -65
- package/src/utils/axios.ts +149 -132
package/dist/tools-lib.esm.js
CHANGED
|
@@ -1268,23 +1268,23 @@ var Predefined = {
|
|
|
1268
1268
|
get EnumContractStatus () { return EnumContractStatus; }
|
|
1269
1269
|
};
|
|
1270
1270
|
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1271
|
+
// 200: '服务器成功返回请求的数据。',
|
|
1272
|
+
// 201: '新建或修改数据成功。',
|
|
1273
|
+
// 202: '一个请求已经进入后台排队(异步任务)。',
|
|
1274
|
+
// 204: '删除数据成功。',
|
|
1275
|
+
// 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
|
|
1276
|
+
// 401: '用户没有权限(令牌、用户名、密码错误)。',
|
|
1277
|
+
// 403: '用户得到授权,但是访问是被禁止的。',
|
|
1278
|
+
// 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
|
|
1279
|
+
// 406: '请求的格式不可得。',
|
|
1280
|
+
// 410: '请求的资源被永久删除,且不会再得到的。',
|
|
1281
|
+
// 422: '当创建一个对象时,发生一个验证错误。',
|
|
1282
|
+
// 500: '服务器发生错误,请检查服务器。',
|
|
1283
|
+
// 502: '网关错误。',
|
|
1284
|
+
// 503: '服务不可用,服务器暂时过载或维护。',
|
|
1285
|
+
// 504: '网关超时。',
|
|
1286
|
+
// };
|
|
1287
|
+
// export let apiHost: string = '';
|
|
1288
1288
|
|
|
1289
1289
|
if (window.location.hostname.includes('.com')) {
|
|
1290
1290
|
// apiHost = `${window.location.protocol}//qi.${(window.location.host.match(/(?<=\.).*/) || [''])[0]}`;
|
|
@@ -1315,59 +1315,28 @@ if (window.location.hostname.includes('.com')) {
|
|
|
1315
1315
|
// };
|
|
1316
1316
|
//
|
|
1317
1317
|
// // Add a request interceptor
|
|
1318
|
+
// axios.interceptors.request.use(function (config) {
|
|
1319
|
+
// // Do something before request is sent
|
|
1320
|
+
// NProgress.start();
|
|
1321
|
+
// return config;
|
|
1322
|
+
// }, function (error) {
|
|
1323
|
+
// // Do something with request error
|
|
1324
|
+
// NProgress.done();
|
|
1325
|
+
// return Promise.reject(error);
|
|
1326
|
+
// });
|
|
1318
1327
|
|
|
1319
1328
|
|
|
1320
1329
|
axios.interceptors.request.use(function (config) {
|
|
1321
|
-
|
|
1322
|
-
NProgress.start();
|
|
1330
|
+
NProgress.inc();
|
|
1323
1331
|
return config;
|
|
1324
1332
|
}, function (error) {
|
|
1325
|
-
// Do something with request error
|
|
1326
1333
|
NProgress.done();
|
|
1327
1334
|
return Promise.reject(error);
|
|
1328
1335
|
});
|
|
1329
|
-
|
|
1330
|
-
* 配置request请求时的默认参数
|
|
1331
|
-
*/
|
|
1332
|
-
|
|
1333
|
-
axios.interceptors.response.use(function (response) {
|
|
1334
|
-
var _headers$contentDisp;
|
|
1335
|
-
|
|
1336
|
-
// Do something with response data
|
|
1337
|
-
// console.log(response, 'response!!!!!!');
|
|
1336
|
+
axios.interceptors.response.use(function (res) {
|
|
1338
1337
|
NProgress.done();
|
|
1339
|
-
|
|
1340
|
-
if (response.status !== 200) {
|
|
1341
|
-
var error = {
|
|
1342
|
-
description: codeMessage[response.status],
|
|
1343
|
-
message: response.status
|
|
1344
|
-
}; // notification.error(error);
|
|
1345
|
-
|
|
1346
|
-
throw new Error(JSON.stringify(error));
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
var data = response.data,
|
|
1350
|
-
headers = response.headers;
|
|
1351
|
-
|
|
1352
|
-
if ((_headers$contentDisp = headers['content-disposition']) != null && _headers$contentDisp.includes('attachment;')) {
|
|
1353
|
-
// downloadFile(response);
|
|
1354
|
-
return;
|
|
1355
|
-
} // console.log(data, 'data2390jasdflkf');
|
|
1356
|
-
// if ((data.errcode === undefined
|
|
1357
|
-
// ? (data.errCode !== 0 && data.errCode !== 2)
|
|
1358
|
-
// : (data.errcode !== 0 && data.errcode !== 2))
|
|
1359
|
-
// || data.ret !== 0) {
|
|
1360
|
-
//
|
|
1361
|
-
// // notification.error({
|
|
1362
|
-
// // message: data.msg,
|
|
1363
|
-
// // });
|
|
1364
|
-
// throw new Error(JSON.stringify(data));
|
|
1365
|
-
// }
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
return data;
|
|
1338
|
+
return res;
|
|
1369
1339
|
}, function (error) {
|
|
1370
|
-
// Do something with response error
|
|
1371
1340
|
NProgress.done();
|
|
1372
1341
|
return Promise.reject(error);
|
|
1373
1342
|
});
|
|
@@ -1501,8 +1470,7 @@ function details(params) {
|
|
|
1501
1470
|
// return FUtil.Axios.get(`/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`);
|
|
1502
1471
|
return FUtil.Request({
|
|
1503
1472
|
method: 'GET',
|
|
1504
|
-
url: "/v2/nodes/" + params.nodeId
|
|
1505
|
-
params: params
|
|
1473
|
+
url: "/v2/nodes/" + params.nodeId
|
|
1506
1474
|
});
|
|
1507
1475
|
} // return FUtil.Axios.get(`/v2/nodes/detail`, {
|
|
1508
1476
|
// params,
|