ls-pro-common 1.0.13 → 1.0.14

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.
@@ -20,10 +20,10 @@ export declare function httpPost(url: string, data?: Record<string, any>, isJson
20
20
  * put 请求
21
21
  * @param url 接口
22
22
  * @param data 参数{key:value}
23
- * @param needGateWay 是否需要网关 默认为true
23
+ * @param needGateWay 是否需要网关 默认为true
24
24
  * @returns Promise<ApiResponse>
25
25
  */
26
- export declare function httpPut(url: string, data?: Record<string, any>): Promise<any>;
26
+ export declare function httpPut(url: string, data?: Record<string, any>, needGateWay?: boolean): Promise<any>;
27
27
  /**
28
28
  * delete 请求
29
29
  * @param url 接口
@@ -31,7 +31,7 @@ export declare function httpPut(url: string, data?: Record<string, any>): Promis
31
31
  * @param needGateWay 是否需要网关 默认为true
32
32
  * @returns Promise<ApiResponse>
33
33
  */
34
- export declare function httpDelete(url: string, data: any): Promise<any>;
34
+ export declare function httpDelete(url: string, data: any, needGateWay?: boolean): Promise<any>;
35
35
  /**
36
36
  * 读取数据字典
37
37
  * @param dictCode 字典编码
package/es/http/index.js CHANGED
@@ -137,7 +137,7 @@ export function httpPost(_x4) {
137
137
  * put 请求
138
138
  * @param url 接口
139
139
  * @param data 参数{key:value}
140
- * @param needGateWay 是否需要网关 默认为true
140
+ * @param needGateWay 是否需要网关 默认为true
141
141
  * @returns Promise<ApiResponse>
142
142
  */
143
143
 
@@ -188,17 +188,24 @@ export function httpPut(_x5) {
188
188
  function _httpPut() {
189
189
  _httpPut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url) {
190
190
  var data,
191
+ needGateWay,
191
192
  _args4 = arguments;
192
193
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
193
194
  while (1) {
194
195
  switch (_context4.prev = _context4.next) {
195
196
  case 0:
196
197
  data = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
198
+ needGateWay = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : true;
199
+
200
+ if (needGateWay) {
201
+ url = toGatewayUrl(url);
202
+ }
203
+
197
204
  return _context4.abrupt("return", request.put(url, {
198
205
  data: data
199
206
  }));
200
207
 
201
- case 2:
208
+ case 4:
202
209
  case "end":
203
210
  return _context4.stop();
204
211
  }
@@ -220,15 +227,23 @@ export function httpDelete(_x6, _x7) {
220
227
 
221
228
  function _httpDelete() {
222
229
  _httpDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url, data) {
230
+ var needGateWay,
231
+ _args5 = arguments;
223
232
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
224
233
  while (1) {
225
234
  switch (_context5.prev = _context5.next) {
226
235
  case 0:
236
+ needGateWay = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : true;
237
+
238
+ if (needGateWay) {
239
+ url = toGatewayUrl(url);
240
+ }
241
+
227
242
  return _context5.abrupt("return", request.delete(url, {
228
243
  data: data
229
244
  }));
230
245
 
231
- case 1:
246
+ case 3:
232
247
  case "end":
233
248
  return _context5.stop();
234
249
  }
@@ -20,10 +20,10 @@ export declare function httpPost(url: string, data?: Record<string, any>, isJson
20
20
  * put 请求
21
21
  * @param url 接口
22
22
  * @param data 参数{key:value}
23
- * @param needGateWay 是否需要网关 默认为true
23
+ * @param needGateWay 是否需要网关 默认为true
24
24
  * @returns Promise<ApiResponse>
25
25
  */
26
- export declare function httpPut(url: string, data?: Record<string, any>): Promise<any>;
26
+ export declare function httpPut(url: string, data?: Record<string, any>, needGateWay?: boolean): Promise<any>;
27
27
  /**
28
28
  * delete 请求
29
29
  * @param url 接口
@@ -31,7 +31,7 @@ export declare function httpPut(url: string, data?: Record<string, any>): Promis
31
31
  * @param needGateWay 是否需要网关 默认为true
32
32
  * @returns Promise<ApiResponse>
33
33
  */
34
- export declare function httpDelete(url: string, data: any): Promise<any>;
34
+ export declare function httpDelete(url: string, data: any, needGateWay?: boolean): Promise<any>;
35
35
  /**
36
36
  * 读取数据字典
37
37
  * @param dictCode 字典编码
package/lib/http/index.js CHANGED
@@ -157,7 +157,7 @@ function httpPost(_x4) {
157
157
  * put 请求
158
158
  * @param url 接口
159
159
  * @param data 参数{key:value}
160
- * @param needGateWay 是否需要网关 默认为true
160
+ * @param needGateWay 是否需要网关 默认为true
161
161
  * @returns Promise<ApiResponse>
162
162
  */
163
163
 
@@ -210,17 +210,24 @@ function httpPut(_x5) {
210
210
  function _httpPut() {
211
211
  _httpPut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(url) {
212
212
  var data,
213
+ needGateWay,
213
214
  _args4 = arguments;
214
215
  return _regenerator.default.wrap(function _callee4$(_context4) {
215
216
  while (1) {
216
217
  switch (_context4.prev = _context4.next) {
217
218
  case 0:
218
219
  data = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
220
+ needGateWay = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : true;
221
+
222
+ if (needGateWay) {
223
+ url = (0, _utils.toGatewayUrl)(url);
224
+ }
225
+
219
226
  return _context4.abrupt("return", request.put(url, {
220
227
  data: data
221
228
  }));
222
229
 
223
- case 2:
230
+ case 4:
224
231
  case "end":
225
232
  return _context4.stop();
226
233
  }
@@ -243,15 +250,23 @@ function httpDelete(_x6, _x7) {
243
250
 
244
251
  function _httpDelete() {
245
252
  _httpDelete = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(url, data) {
253
+ var needGateWay,
254
+ _args5 = arguments;
246
255
  return _regenerator.default.wrap(function _callee5$(_context5) {
247
256
  while (1) {
248
257
  switch (_context5.prev = _context5.next) {
249
258
  case 0:
259
+ needGateWay = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : true;
260
+
261
+ if (needGateWay) {
262
+ url = (0, _utils.toGatewayUrl)(url);
263
+ }
264
+
250
265
  return _context5.abrupt("return", request.delete(url, {
251
266
  data: data
252
267
  }));
253
268
 
254
- case 1:
269
+ case 3:
255
270
  case "end":
256
271
  return _context5.stop();
257
272
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "ls-pro-common",
5
5
  "keywords": [
6
6
  "antd",