一个模块下主要是这几个方法:
constructor(http) {
this.http = http;
this.list = this.list.bind(this); 分页请求get
this.all = this.all.bind(this); 请求全部get
this.delete = this.delete.bind(this); 删除delete
this.update = this.update.bind(this); 更新put
this.create = this.create.bind(this); 新建post
}
新增了approve, cancel两个请求



重点是create, arg参数部分和response响应部分

all一次请求全部,list分页请求

分页的测试

一次请求的测试

删除一项

更新一项使用put方法需要带payload

更新部分需要在API types文件里面修改TS配置



网友评论