引入axios

组件   axios

main.js


import axios from 'axios'
Vue.prototype.$axios = axios;

axios.defaults.withCredentials = true

axios.defaults.baseURL='http://localhost:8082'

new Vue({
  router,
  axios,
  render: h => h(App)
}).$mount("#app")

调用
this.$axios({})

 

 
 
 
posted @ 2022-05-26 11:34  快了星球  阅读(157)  评论(0)    收藏  举报