此请求后:
axios
.post(url_auth, obj)
.then(response => {
const info = response.data
this.setState({info})
})
.catch(error => {
console.log(error);
});
我存储在info中,带有ID和令牌的JSON。 (后端发送给我)
我现在想将令牌存储在我提出的每个请求的headers中。
我该如何搭配?我猜用interceptor吗?一旦我在拦截器中配置了标头(我试图了解如何),如何在请求中调用它?
非常感谢!