Vue中axios学习(三)axios全局配置
<script>axios.default.baseURL = 'http://localhost:9999/student/student';axios.default.timeout = 5;axios.get('getAllStudent').then(res=>{console.log(res);});axios.post('pGet').then(res=>{
·
<script>
axios.default.baseURL = 'http://localhost:9999/student/student';
axios.default.timeout = 5;
axios.get('getAllStudent').then(res=>{
console.log(res);
});
axios.post('pGet').then(res=>{
console.log(res);
}).catch(err=>{
console.log(err);
})
</script>
更多推荐
已为社区贡献4条内容
所有评论(0)