@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
|
@@ -1274,23 +1274,23 @@ var Predefined = {
|
|
|
1274
1274
|
get EnumContractStatus () { return EnumContractStatus; }
|
|
1275
1275
|
};
|
|
1276
1276
|
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1277
|
+
// 200: '服务器成功返回请求的数据。',
|
|
1278
|
+
// 201: '新建或修改数据成功。',
|
|
1279
|
+
// 202: '一个请求已经进入后台排队(异步任务)。',
|
|
1280
|
+
// 204: '删除数据成功。',
|
|
1281
|
+
// 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
|
|
1282
|
+
// 401: '用户没有权限(令牌、用户名、密码错误)。',
|
|
1283
|
+
// 403: '用户得到授权,但是访问是被禁止的。',
|
|
1284
|
+
// 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
|
|
1285
|
+
// 406: '请求的格式不可得。',
|
|
1286
|
+
// 410: '请求的资源被永久删除,且不会再得到的。',
|
|
1287
|
+
// 422: '当创建一个对象时,发生一个验证错误。',
|
|
1288
|
+
// 500: '服务器发生错误,请检查服务器。',
|
|
1289
|
+
// 502: '网关错误。',
|
|
1290
|
+
// 503: '服务不可用,服务器暂时过载或维护。',
|
|
1291
|
+
// 504: '网关超时。',
|
|
1292
|
+
// };
|
|
1293
|
+
// export let apiHost: string = '';
|
|
1294
1294
|
|
|
1295
1295
|
if (window.location.hostname.includes('.com')) {
|
|
1296
1296
|
// apiHost = `${window.location.protocol}//qi.${(window.location.host.match(/(?<=\.).*/) || [''])[0]}`;
|
|
@@ -1321,59 +1321,28 @@ if (window.location.hostname.includes('.com')) {
|
|
|
1321
1321
|
// };
|
|
1322
1322
|
//
|
|
1323
1323
|
// // Add a request interceptor
|
|
1324
|
+
// axios.interceptors.request.use(function (config) {
|
|
1325
|
+
// // Do something before request is sent
|
|
1326
|
+
// NProgress.start();
|
|
1327
|
+
// return config;
|
|
1328
|
+
// }, function (error) {
|
|
1329
|
+
// // Do something with request error
|
|
1330
|
+
// NProgress.done();
|
|
1331
|
+
// return Promise.reject(error);
|
|
1332
|
+
// });
|
|
1324
1333
|
|
|
1325
1334
|
|
|
1326
1335
|
axios.interceptors.request.use(function (config) {
|
|
1327
|
-
|
|
1328
|
-
NProgress.start();
|
|
1336
|
+
NProgress.inc();
|
|
1329
1337
|
return config;
|
|
1330
1338
|
}, function (error) {
|
|
1331
|
-
// Do something with request error
|
|
1332
1339
|
NProgress.done();
|
|
1333
1340
|
return Promise.reject(error);
|
|
1334
1341
|
});
|
|
1335
|
-
|
|
1336
|
-
* 配置request请求时的默认参数
|
|
1337
|
-
*/
|
|
1338
|
-
|
|
1339
|
-
axios.interceptors.response.use(function (response) {
|
|
1340
|
-
var _headers$contentDisp;
|
|
1341
|
-
|
|
1342
|
-
// Do something with response data
|
|
1343
|
-
// console.log(response, 'response!!!!!!');
|
|
1342
|
+
axios.interceptors.response.use(function (res) {
|
|
1344
1343
|
NProgress.done();
|
|
1345
|
-
|
|
1346
|
-
if (response.status !== 200) {
|
|
1347
|
-
var error = {
|
|
1348
|
-
description: codeMessage[response.status],
|
|
1349
|
-
message: response.status
|
|
1350
|
-
}; // notification.error(error);
|
|
1351
|
-
|
|
1352
|
-
throw new Error(JSON.stringify(error));
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
var data = response.data,
|
|
1356
|
-
headers = response.headers;
|
|
1357
|
-
|
|
1358
|
-
if ((_headers$contentDisp = headers['content-disposition']) != null && _headers$contentDisp.includes('attachment;')) {
|
|
1359
|
-
// downloadFile(response);
|
|
1360
|
-
return;
|
|
1361
|
-
} // console.log(data, 'data2390jasdflkf');
|
|
1362
|
-
// if ((data.errcode === undefined
|
|
1363
|
-
// ? (data.errCode !== 0 && data.errCode !== 2)
|
|
1364
|
-
// : (data.errcode !== 0 && data.errcode !== 2))
|
|
1365
|
-
// || data.ret !== 0) {
|
|
1366
|
-
//
|
|
1367
|
-
// // notification.error({
|
|
1368
|
-
// // message: data.msg,
|
|
1369
|
-
// // });
|
|
1370
|
-
// throw new Error(JSON.stringify(data));
|
|
1371
|
-
// }
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
return data;
|
|
1344
|
+
return res;
|
|
1375
1345
|
}, function (error) {
|
|
1376
|
-
// Do something with response error
|
|
1377
1346
|
NProgress.done();
|
|
1378
1347
|
return Promise.reject(error);
|
|
1379
1348
|
});
|
|
@@ -1507,8 +1476,7 @@ function details(params) {
|
|
|
1507
1476
|
// return FUtil.Axios.get(`/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`);
|
|
1508
1477
|
return FUtil.Request({
|
|
1509
1478
|
method: 'GET',
|
|
1510
|
-
url: "/v2/nodes/" + params.nodeId
|
|
1511
|
-
params: params
|
|
1479
|
+
url: "/v2/nodes/" + params.nodeId
|
|
1512
1480
|
});
|
|
1513
1481
|
} // return FUtil.Axios.get(`/v2/nodes/detail`, {
|
|
1514
1482
|
// params,
|