1
1
// @ts -ignore
2
2
/* eslint-disable */
3
- import { request } from '@umijs/max' ;
3
+ import { get , post } from "@/services/api/index" ;
4
4
5
5
6
6
export async function list (
@@ -11,51 +11,23 @@ export async function list(
11
11
/** 页面的容量 */
12
12
pageSize ?: number ;
13
13
} ,
14
- options ?: { [ key : string ] : any } ,
15
14
) {
16
- return request < API . Response < any > > ( '/api/api/list' , {
17
- method : 'GET' ,
18
- params : {
19
- ...params ,
20
- } ,
21
- ...( options || { } ) ,
22
- } ) ;
15
+ return get ( '/api/api/list' , params ) ;
23
16
}
24
17
25
18
26
- export async function test ( body : any , options ?: { [ key : string ] : any } ) {
27
- return request < API . Response < any > > ( '/api/api/test' , {
28
- method : 'POST' ,
29
- headers : {
30
- 'Content-Type' : 'application/json' ,
31
- } ,
32
- data : body ,
33
- ...( options || { } ) ,
34
- } ) ;
19
+ export async function test ( body : any ) {
20
+ return post ( '/api/api/test' , body )
35
21
}
36
22
37
23
38
- export async function save ( body : any , options ?: { [ key : string ] : any } ) {
39
- return request < API . Response < any > > ( '/api/api/save' , {
40
- method : 'POST' ,
41
- headers : {
42
- 'Content-Type' : 'application/json' ,
43
- } ,
44
- data : body ,
45
- ...( options || { } ) ,
46
- } ) ;
24
+ export async function save ( body : any ) {
25
+ return post ( '/api/api/save' , body )
47
26
}
48
27
49
28
50
29
export async function del ( body : {
51
- id :string ,
52
- } , options ?: { [ key : string ] : any } ) {
53
- return request < API . Response < any > > ( '/api/api/delete' , {
54
- method : 'POST' ,
55
- headers : {
56
- 'Content-Type' : 'application/json' ,
57
- } ,
58
- data : body ,
59
- ...( options || { } ) ,
60
- } ) ;
30
+ id : string ,
31
+ } ) {
32
+ return post ( '/api/api/delete' , body )
61
33
}
0 commit comments