我這里用來設(shè)置全局的Authorization
推薦書寫位置在constructor中,一般寫在登錄完成后
constructor(props){
super(props);
axios.defaults.headers['Authorization'] = getLoginToken();
}
axios.defaults.headers['Authorization'] =xxxx
推薦書寫位置在constructor中,一般寫在登錄完成后
constructor(props){
super(props);
axios.defaults.headers['Authorization'] = getLoginToken();
}
axios.defaults.headers['Authorization'] =xxxx