axios与vue的封装 var $axios axios.create({baseURL: http://localhost:8080/, //设置基本路径// withCredentials 表示跨域请求时是否需要使用凭证(是否发送sessionid)withCredentials: true, // 默认的 }); //判断Vue是否存在 if (Vue) {//给Vue对象添加axios的原型属性Vue.prototype.$axios $axios;//给Vue添加一个原型函数,其中参数为promiseHandler为一个axios请求函数Vue.prototype.$ajax……