接口调用方式

异步

 

 

 

nodemon 安装命令: npm install -g nodemon

 

 

promise

基于Promise发送Ajax请求

promise 返回值

 

Promise 基本API

实例方法

.then()
.catch()
.finally()

静态方法

.all()
.race()

 

 

fetch

fetch API 中的 HTTP 请求

 

fetchAPI 中 响应格式

axios

axios基础用法

axios 全局配置

axios 拦截器

async 和 await

图书列表案例

1. 基于接口案例-获取图书列表

2 添加图书

3 验证图书名称是否存在

4. 编辑图书

5 删除图书