@jetlinks-web/core 2.1.2 → 2.1.4
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/package.json +9 -5
- package/src/axios.ts +6 -6
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetlinks-web/core",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "2.1.4",
|
|
5
4
|
"main": "index.ts",
|
|
6
5
|
"module": "index.ts",
|
|
7
6
|
"keywords": [
|
|
8
|
-
"
|
|
7
|
+
"jetlinks",
|
|
8
|
+
"jetlinks-web",
|
|
9
|
+
"core",
|
|
10
|
+
"jetlinks-web/core",
|
|
11
|
+
"@jetlinks-web",
|
|
12
|
+
"@jetlinks-web/core"
|
|
9
13
|
],
|
|
10
14
|
"files": [
|
|
11
15
|
"src",
|
|
@@ -17,9 +21,9 @@
|
|
|
17
21
|
"dependencies": {
|
|
18
22
|
"axios": "^1.7.4",
|
|
19
23
|
"rxjs": "^7.8.1",
|
|
20
|
-
"@jetlinks-web/constants": "^1.0.7",
|
|
21
24
|
"@jetlinks-web/types": "^1.0.2",
|
|
22
|
-
"@jetlinks-web/
|
|
25
|
+
"@jetlinks-web/constants": "^1.0.8",
|
|
26
|
+
"@jetlinks-web/utils": "^1.2.8"
|
|
23
27
|
},
|
|
24
28
|
"publishConfig": {
|
|
25
29
|
"registry": "https://registry.npmjs.org/",
|
package/src/axios.ts
CHANGED
|
@@ -244,7 +244,7 @@ export class Request {
|
|
|
244
244
|
* @param {object} options 请求配置
|
|
245
245
|
* @returns {Promise<AxiosResponse<any>>} 分页查询结果
|
|
246
246
|
*/
|
|
247
|
-
page(data: any, options: RequestOptions= {
|
|
247
|
+
page(data: any={}, options: RequestOptions= {
|
|
248
248
|
url: undefined,
|
|
249
249
|
method: undefined,
|
|
250
250
|
}) {
|
|
@@ -258,7 +258,7 @@ export class Request {
|
|
|
258
258
|
* @param {object} options 请求配置
|
|
259
259
|
* @returns {Promise<AxiosResponse<any>>} 不分页查询结果
|
|
260
260
|
*/
|
|
261
|
-
noPage(data?: any, options: RequestOptions = {
|
|
261
|
+
noPage(data?: any={}, options: RequestOptions = {
|
|
262
262
|
url: undefined,
|
|
263
263
|
method: undefined,
|
|
264
264
|
}) {
|
|
@@ -287,25 +287,25 @@ export class Request {
|
|
|
287
287
|
* @param {object} options 请求配置
|
|
288
288
|
* @returns {Promise<AxiosResponse<any>>} 保存结果
|
|
289
289
|
*/
|
|
290
|
-
save(data: any, options: RequestOptions = {
|
|
290
|
+
save(data: any={}, options: RequestOptions = {
|
|
291
291
|
url: undefined,
|
|
292
292
|
method: undefined,
|
|
293
293
|
}) {
|
|
294
294
|
const { url=``, method = 'post', ...rest } = options
|
|
295
295
|
return request[method](`${this.modulePath}${url}`, data, rest)
|
|
296
296
|
}
|
|
297
|
-
|
|
297
|
+
|
|
298
298
|
/**
|
|
299
299
|
* 更新
|
|
300
300
|
* @param {object} data 更新参数
|
|
301
301
|
* @param {object} options 请求配置
|
|
302
302
|
* @returns {Promise<AxiosResponse<any>>} 更新结果
|
|
303
303
|
*/
|
|
304
|
-
update(data: any, options: RequestOptions = {
|
|
304
|
+
update(data: any={}, options: RequestOptions = {
|
|
305
305
|
url: undefined,
|
|
306
306
|
method: undefined,
|
|
307
307
|
}) {
|
|
308
|
-
const { url=``, method = '
|
|
308
|
+
const { url=``, method = 'patch', ...rest } = options
|
|
309
309
|
return patch(`${this.modulePath}${url}`, data, rest)
|
|
310
310
|
}
|
|
311
311
|
|