axios.get 请求附带参数、设置header的方法 18037128621 2019-08-28 12,667 阅读1分钟 return axios.get(url, { params: data, //附带参数 headers: {'authorization': 'xxxxxx'} //设置header信息 }).then((res) => { //then 成功 console.log("获取到信息") }).catch((err) => { //catch 失败 console.log("获取信息失败") });