Attach Authorization header for all axios requests
问题 I have a react/redux application that fetches a token from an api server. After the user authenticates I'd like to make all axios requests have that token as an Authorization header without having to manually attach it to every request in the action. I'm fairly new to react/redux and am not sure on the best approach and am not finding any quality hits on google. Here is my redux setup: // actions.js import axios from 'axios'; export function loginUser(props) { const url = `https://api