axios实例
<script> let newVar=axios.create({ baseURL:'http://localhost:8080/student', timeout:5000 });//创建axios实例 let newVar1=axios.create({ baseURL:'http://localhost:9999/student', timeout:5000 });//创建axios实例 newVar({ url:'getAllStudent' }).then(res=>{ console.log(res); }); newVar1({ url:'getStudentById' }).then(res=>{ console.log(res); }).catch(err=>{ console.log(err); }); </script>