diff --git a/report-ui/src/api/axios.js b/report-ui/src/api/axios.js index 458975f3..93561583 100644 --- a/report-ui/src/api/axios.js +++ b/report-ui/src/api/axios.js @@ -10,7 +10,6 @@ const service = axios.create({ timeout: 60000, headers: { 'Content-Type': 'application/json', - 'Authorization': getItem('token') } }) diff --git a/report-ui/src/utils/request.js b/report-ui/src/utils/request.js index 7744512e..cd85d485 100644 --- a/report-ui/src/utils/request.js +++ b/report-ui/src/utils/request.js @@ -12,9 +12,7 @@ const service = axios.create({ // request拦截器 service.interceptors.request.use( config => { - if (store.getters.token) { - config.headers['X-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 - } + config.headers['Authorization'] = (getToken() == null || getToken() == undefined) ? '': getToken() return config }, error => {