# 封装 ajax请求
> 封装ajax请求 以便使用

### 例：导入ajax请求 文件模块
```
import {getStudents,addStudent} from './students/students.js'
```
### 例：搜索学生信息

```
getStudents({name:"王"})
.then((res)=>{
  console.log(res.data)
})
```
###  例：添加信息
```
var student = {
  name:'张爱婷',
  age:18,
  isMale:false,
  email:'aaaa@qq.com',
  phone:'15788888888'
}
addStudent(student)
.then(function(res){
  console.log(res)
})
```