return函数提前传参和面向对象的编程方式
function request({method,data}){f.c(data)}
function get(v){
return request({method:'GET', data:v})
}
function post(v){
return request({method:'POST',data:v})
}
![](https://img2018.cnblogs.com/blog/1513116/201810/1513116-20181021152825718-521105427.png)
![](https://img2018.cnblogs.com/blog/1513116/201810/1513116-20181021192730422-11586574.png)
![](https://img2018.cnblogs.com/blog/1513116/201810/1513116-20181021211136210-1337778077.png)
![](https://img2018.cnblogs.com/blog/1513116/201810/1513116-20181021211149303-722562613.png)
特点:
注意:
1。它们的参数是一个对象和对应关系
2。return 提前传一个值
1.request ({ method, data })
2.return ({ method:'GET', data:v})