@be-link/request 1.6.0 → 1.8.0
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/README.md +15 -0
- package/dist/callFunction.d.ts +5 -5
- package/package.json +2 -2
- package/dist/callFunction/callFunction.d.ts +0 -36
- package/dist/callFunction/config.d.ts +0 -4
- package/dist/callFunction/index.d.ts +0 -2
- package/dist/request/index.d.ts +0 -2
- package/dist/request/request.d.ts +0 -12
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
+
### use callFunction
|
|
8
|
+
|
|
7
9
|
```
|
|
8
10
|
import { callFunction } from '@be-link/request'
|
|
9
11
|
|
|
@@ -17,3 +19,16 @@ function requestAction(param: string) {
|
|
|
17
19
|
})
|
|
18
20
|
}
|
|
19
21
|
```
|
|
22
|
+
|
|
23
|
+
### use request
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
import { request } from '@be-link/request'
|
|
27
|
+
|
|
28
|
+
function requestAction(param: string) {
|
|
29
|
+
return request({
|
|
30
|
+
url: http.requestUrl,
|
|
31
|
+
data,
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
```
|
package/dist/callFunction.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export interface INotData<T> {
|
|
2
2
|
apiName: string;
|
|
3
3
|
funcName: string;
|
|
4
|
-
param
|
|
4
|
+
param?: T;
|
|
5
5
|
[str: string]: any;
|
|
6
6
|
operateUser?: Record<string, any>;
|
|
7
7
|
}
|
|
8
8
|
export interface IData<T> {
|
|
9
|
-
moduleName
|
|
10
|
-
serviceName
|
|
11
|
-
funcName
|
|
12
|
-
param
|
|
9
|
+
moduleName?: string;
|
|
10
|
+
serviceName?: string;
|
|
11
|
+
funcName?: string;
|
|
12
|
+
param?: T;
|
|
13
13
|
[str: string]: any;
|
|
14
14
|
operateUser?: Record<string, any>;
|
|
15
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@be-link/request",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "共比邻 request 库",
|
|
6
6
|
"author": "zhuifeng <yangyiboys@163.com>",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "b54199aff2074d1907a1b528973e3cb03d125af9"
|
|
35
35
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export interface INotData<T> {
|
|
2
|
-
apiName: string;
|
|
3
|
-
funcName: string;
|
|
4
|
-
param: T;
|
|
5
|
-
[str: string]: any;
|
|
6
|
-
operateUser?: Record<string, any>;
|
|
7
|
-
}
|
|
8
|
-
export interface IData<T> {
|
|
9
|
-
moduleName: string;
|
|
10
|
-
serviceName: string;
|
|
11
|
-
funcName: string;
|
|
12
|
-
param: T;
|
|
13
|
-
[str: string]: any;
|
|
14
|
-
operateUser?: Record<string, any>;
|
|
15
|
-
}
|
|
16
|
-
export interface ICallFunctionOptions<T> {
|
|
17
|
-
name: string;
|
|
18
|
-
data: IData<T> | INotData<T>;
|
|
19
|
-
query?: Record<string, any>;
|
|
20
|
-
search?: string;
|
|
21
|
-
parse?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface ICallFunctionResponse<K> {
|
|
24
|
-
requestId: string;
|
|
25
|
-
data?: {
|
|
26
|
-
response_data?: string;
|
|
27
|
-
};
|
|
28
|
-
result?: {
|
|
29
|
-
msg: string;
|
|
30
|
-
data: K;
|
|
31
|
-
errorCode: number;
|
|
32
|
-
success: boolean;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
declare function callFunction<T, K>(params: ICallFunctionOptions<T>): Promise<K>;
|
|
36
|
-
export default callFunction;
|
package/dist/request/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Method } from 'axios';
|
|
2
|
-
interface IConfig {
|
|
3
|
-
method?: Method;
|
|
4
|
-
data?: any;
|
|
5
|
-
url: string;
|
|
6
|
-
headers?: Record<string, any>;
|
|
7
|
-
params?: Record<string, any>;
|
|
8
|
-
requestInterceptors?: any;
|
|
9
|
-
responseInterceptors?: any;
|
|
10
|
-
}
|
|
11
|
-
declare function request(config: IConfig): Promise<unknown>;
|
|
12
|
-
export default request;
|