npm install request-funjs
import Request from 'request-funjs';
Vue.prototype.Request = Request;
//在这里需要声明一个 host 变量,作为请求的主机名称
Request.host = 'https://www.baidu.com'
import Request from 'request-funjs';
//在这里需要声明一个 host 变量,作为请求的主机名称
this.Request.host = 'https://www.baidu.com'
this.Request.Get("api/list",this.params,
res => {
console.log(res);
},
err => {
console.log(err);
})
1、get请求 :
Request.Get
2、post请求 :
Request.Post
3、批量post :
Request.PostBatch
4、put请求 :
Request.Put
5、delete请求
Request.Delete
6、批量delete :
Request.DeleteBatch
7、微信分享 :
Request.SetShare
If you like, please give me a star ⭐