為什么我創(chuàng)建實(shí)例后看不到token呢,也沒(méi)有報(bào)錯(cuò),前臺(tái)能收到響應(yīng)
axios.get('/list').then((res)?=>?{
????????????????console.log(res);
????????})
//?添加請(qǐng)求攔截器
axios.interceptors.request.use(function?(config)?{
????????????//?在發(fā)送請(qǐng)求之前做些什么
????????????console.log(111);
????????????config.headers.token?=?'1111';
????????????return?config;
????????},?function?(error)?{
????????????//?對(duì)請(qǐng)求錯(cuò)誤做些什么
????????????return?Promise.reject(error);
????????});
2021-06-08
截圖發(fā)一下,在請(qǐng)求頭信息里沒(méi)有嗎?