<button id="btnGET">axios.get</button>
<button id="btnPOST">axios.post</button>
</body>
<script>
document.querySelector('#btnGET').addEventListener('click',async ()=>{
const {data:res} = await axios.get('http://www.liulongbin.top:3006/api/getbooks',
{
params:{id:1}
})
console.log(res.data)
})
document.querySelector('#btnPOST').addEventListener('click',async ()=>{
const {data:res} = await axios.post('http://www.liulongbin.top:3006/api/post',{
name:'zs',
age:'17'
})
console.log(res.body)
})