axios请求添加请求头 标准写法

export const getUserInfo = () => {
  return: 'GET',
  url: '/app/v123/user',
  // 发送请求请求头数据
  headers: {
    // 注意: 该接口需要授权才能访问
    // token的数据格式: Bearer token 数据,注意 Bearer 后面有
    Authorization: `Bearer ${store.state.user.token}` 
}  
}
原文地址:https://www.cnblogs.com/wsm777/p/13861042.html