ydb-components-material 0.1.126 → 0.1.127

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/api.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import axios from 'axios';
3
4
  export var post = /*#__PURE__*/function () {
4
5
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, data, config, noJson) {
5
- var res;
6
+ var response, _t;
6
7
  return _regeneratorRuntime.wrap(function (_context) {
7
8
  while (1) switch (_context.prev = _context.next) {
8
9
  case 0:
@@ -14,32 +15,31 @@ export var post = /*#__PURE__*/function () {
14
15
  // if (config.env === 'release' && url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1) {
15
16
  // url = url.replace('zwfwpt.sxzwfw.gov.cn', 'zwfwpt.sxzwfw.gov.cn:10010')
16
17
  // }
17
- _context.next = 1;
18
- return fetch(url, {
18
+ _context.prev = 1;
19
+ _context.next = 2;
20
+ return axios({
19
21
  method: 'POST',
22
+ url: url,
23
+ data: data,
20
24
  headers: {
21
25
  'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
22
- // 声明发送的数据格式
23
- // url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? config.token : config.tokenTY
24
26
  'Authorization': config && config.tokenTY ? config.tokenTY : ''
25
27
  },
26
- body: JSON.stringify(data)
27
- }).then(function (response) {
28
- console.log('response', response, response.body);
29
- return noJson ? response.text() : response.json();
30
- }).then(function (res) {
31
- return res;
32
- })["catch"](function (err) {
33
- return err;
28
+ responseType: noJson ? 'text' : 'json'
34
29
  });
35
- case 1:
36
- res = _context.sent;
37
- return _context.abrupt("return", res);
38
30
  case 2:
31
+ response = _context.sent;
32
+ console.log('response', response);
33
+ return _context.abrupt("return", response.data);
34
+ case 3:
35
+ _context.prev = 3;
36
+ _t = _context["catch"](1);
37
+ return _context.abrupt("return", _t);
38
+ case 4:
39
39
  case "end":
40
40
  return _context.stop();
41
41
  }
42
- }, _callee);
42
+ }, _callee, null, [[1, 3]]);
43
43
  }));
44
44
  return function post(_x, _x2, _x3, _x4) {
45
45
  return _ref.apply(this, arguments);
@@ -47,32 +47,33 @@ export var post = /*#__PURE__*/function () {
47
47
  }();
48
48
  export var get = /*#__PURE__*/function () {
49
49
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url, data, config) {
50
- var res;
50
+ var response, _t2;
51
51
  return _regeneratorRuntime.wrap(function (_context2) {
52
52
  while (1) switch (_context2.prev = _context2.next) {
53
53
  case 0:
54
+ _context2.prev = 0;
54
55
  _context2.next = 1;
55
- return fetch(url + "?" + new URLSearchParams(data), {
56
+ return axios({
56
57
  method: 'GET',
58
+ url: url,
59
+ params: data,
57
60
  headers: {
58
61
  'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
59
62
  'Authorization': config && config.tokenTY ? config.tokenTY : ''
60
63
  }
61
- }).then(function (response) {
62
- return response.json();
63
- }).then(function (res) {
64
- return res;
65
- })["catch"](function (err) {
66
- return err;
67
64
  });
68
65
  case 1:
69
- res = _context2.sent;
70
- return _context2.abrupt("return", res);
66
+ response = _context2.sent;
67
+ return _context2.abrupt("return", response.data);
71
68
  case 2:
69
+ _context2.prev = 2;
70
+ _t2 = _context2["catch"](0);
71
+ return _context2.abrupt("return", _t2);
72
+ case 3:
72
73
  case "end":
73
74
  return _context2.stop();
74
75
  }
75
- }, _callee2);
76
+ }, _callee2, null, [[0, 2]]);
76
77
  }));
77
78
  return function get(_x5, _x6, _x7) {
78
79
  return _ref2.apply(this, arguments);
package/lib/api.js CHANGED
@@ -5,9 +5,10 @@ exports.__esModule = true;
5
5
  exports.signurl = exports.signFileDownApi = exports.qrySealApi = exports.previewApi = exports.post = exports.onlinePreview = exports.getUrlById = exports.getSignOrderIdApi = exports.getSignFileApi = exports.getSealUrlApi = exports.getPcSealUrlApi = exports.getMaterialPreview = exports.getMaterialLib = exports.getIcons = exports.getGuideImg = exports.get = exports.fileUploadApi = exports.documentDownload = exports.createbycategory = exports.contractSignUrl = exports.contractFinish = exports.checkSignState = void 0;
6
6
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
7
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
+ var _axios = _interopRequireDefault(require("axios"));
8
9
  var post = exports.post = /*#__PURE__*/function () {
9
10
  var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(url, data, config, noJson) {
10
- var res;
11
+ var response, _t;
11
12
  return _regenerator["default"].wrap(function (_context) {
12
13
  while (1) switch (_context.prev = _context.next) {
13
14
  case 0:
@@ -19,32 +20,31 @@ var post = exports.post = /*#__PURE__*/function () {
19
20
  // if (config.env === 'release' && url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1) {
20
21
  // url = url.replace('zwfwpt.sxzwfw.gov.cn', 'zwfwpt.sxzwfw.gov.cn:10010')
21
22
  // }
22
- _context.next = 1;
23
- return fetch(url, {
23
+ _context.prev = 1;
24
+ _context.next = 2;
25
+ return (0, _axios["default"])({
24
26
  method: 'POST',
27
+ url: url,
28
+ data: data,
25
29
  headers: {
26
30
  'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
27
- // 声明发送的数据格式
28
- // url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? config.token : config.tokenTY
29
31
  'Authorization': config && config.tokenTY ? config.tokenTY : ''
30
32
  },
31
- body: JSON.stringify(data)
32
- }).then(function (response) {
33
- console.log('response', response, response.body);
34
- return noJson ? response.text() : response.json();
35
- }).then(function (res) {
36
- return res;
37
- })["catch"](function (err) {
38
- return err;
33
+ responseType: noJson ? 'text' : 'json'
39
34
  });
40
- case 1:
41
- res = _context.sent;
42
- return _context.abrupt("return", res);
43
35
  case 2:
36
+ response = _context.sent;
37
+ console.log('response', response);
38
+ return _context.abrupt("return", response.data);
39
+ case 3:
40
+ _context.prev = 3;
41
+ _t = _context["catch"](1);
42
+ return _context.abrupt("return", _t);
43
+ case 4:
44
44
  case "end":
45
45
  return _context.stop();
46
46
  }
47
- }, _callee);
47
+ }, _callee, null, [[1, 3]]);
48
48
  }));
49
49
  return function post(_x, _x2, _x3, _x4) {
50
50
  return _ref.apply(this, arguments);
@@ -52,32 +52,33 @@ var post = exports.post = /*#__PURE__*/function () {
52
52
  }();
53
53
  var get = exports.get = /*#__PURE__*/function () {
54
54
  var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(url, data, config) {
55
- var res;
55
+ var response, _t2;
56
56
  return _regenerator["default"].wrap(function (_context2) {
57
57
  while (1) switch (_context2.prev = _context2.next) {
58
58
  case 0:
59
+ _context2.prev = 0;
59
60
  _context2.next = 1;
60
- return fetch(url + "?" + new URLSearchParams(data), {
61
+ return (0, _axios["default"])({
61
62
  method: 'GET',
63
+ url: url,
64
+ params: data,
62
65
  headers: {
63
66
  'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
64
67
  'Authorization': config && config.tokenTY ? config.tokenTY : ''
65
68
  }
66
- }).then(function (response) {
67
- return response.json();
68
- }).then(function (res) {
69
- return res;
70
- })["catch"](function (err) {
71
- return err;
72
69
  });
73
70
  case 1:
74
- res = _context2.sent;
75
- return _context2.abrupt("return", res);
71
+ response = _context2.sent;
72
+ return _context2.abrupt("return", response.data);
76
73
  case 2:
74
+ _context2.prev = 2;
75
+ _t2 = _context2["catch"](0);
76
+ return _context2.abrupt("return", _t2);
77
+ case 3:
77
78
  case "end":
78
79
  return _context2.stop();
79
80
  }
80
- }, _callee2);
81
+ }, _callee2, null, [[0, 2]]);
81
82
  }));
82
83
  return function get(_x5, _x6, _x7) {
83
84
  return _ref2.apply(this, arguments);
@@ -98,7 +98,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
98
98
  packageName = 'ydb-components-material';
99
99
  }
100
100
  if (version === void 0) {
101
- version = '0.1.126';
101
+ version = '0.1.127';
102
102
  }
103
103
  if (basicLibraryVersion === void 0) {
104
104
  basicLibraryVersion = {
@@ -103,7 +103,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
103
103
  packageName = 'ydb-components-material';
104
104
  }
105
105
  if (version === void 0) {
106
- version = '0.1.126';
106
+ version = '0.1.127';
107
107
  }
108
108
  if (basicLibraryVersion === void 0) {
109
109
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.126",
3
+ "version": "0.1.127",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -83,6 +83,7 @@
83
83
  "@alifd/next": "^1.25.27",
84
84
  "@babel/runtime": "^7.0.0",
85
85
  "antd": "^4.24.12",
86
+ "axios": "^1.18.0",
86
87
  "jspdf": "^2.5.1",
87
88
  "mobile-select": "^1.4.0",
88
89
  "moment": "latest",
@@ -101,10 +102,10 @@
101
102
  },
102
103
  "componentConfig": {
103
104
  "isComponentLibrary": true,
104
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.126/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.127/build/lowcode/assets-prod.json"
105
106
  },
106
107
  "lcMeta": {
107
108
  "type": "component"
108
109
  },
109
- "homepage": "https://unpkg.com/ydb-components-material@0.1.126/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.127/build/index.html"
110
111
  }