axios基础(三):axios的常用基础配置 Always_positive 2021-04-08 81 阅读1分钟 常用基础配置 // axios的常用默认配置 axios.defaults.method = 'GET'; axios.defaults.baseURL = 'http://localhost:3000'; axios.defaults.params = {id: 2}; btns[0].onclick = function() { axios({ url: '/posts' }).then(response => {console.log(response);}) }