请求
/** * * @param {*} that this指向 * @param {*} pUrl 公共接口地址 * @param {*} url 详细接口地址 * @param {*} data 形参 * @param {*} cbk 回调函数 */ _Init: function(that, pUrl, url, data, cbk) { axios({ url: pUrl + url, method: "post", data: data, headers: { "Content-Type": "application/json" } }) .then(res => { console.log(res); cbk(res); }) .catch(cat => { console.log("axios的catch", cat); that.$message({ message: "数据异常", center: true }); }); },复制代码