This commit is contained in:
菠萝战士2018 2018-08-15 18:32:41 +08:00
parent ac2b171420
commit 6a28ffef08
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ const service = axios.create({
service.interceptors.request.use(config => {
// if (store.getters.token) {
// config.headers['X-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
// }
// };
if (store.getters.token) {
config.headers.Authorization = `Bearer ${getToken()}`;
}