methods watch computed 实现购物车功能
调接口放置请求头儿
axios.get(url,{
headers:{
authorization: `Bearer ${localStorage.getItem('token')}`,
'content-type':'application/x-www-form-urlencoded'
}
})
axios.post(url,{对象类型的参数},{
headers:{
authorization: `Bearer ${localStorage.getItem('token')}`,
'content-type':'application/x-www-form-urlencoded'
}
})
ajax里面设置请求头
$.ajax({
headers:{}
})
前端面试题
最新推荐文章于 2024-04-25 17:53:04 发布