src/plugin/axios/index.js
@@ -3,7 +3,7 @@ // import toolClass from '@/assets/js/toolClass.js' // 创建 axios 实例 const service = axios.create({ baseURL: myConfig.requestCtx, baseURL: process.env.VUE_APP_API_URL, timeout: myConfig.requestTimeOut // 请求超时时间 }) @@ -11,6 +11,7 @@ service.interceptors.request.use( (config) => { let token = localStorage.getItem(myConfig.tokenKey) config.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate' if (token) config.headers['Authorization'] = `bearer ${token}` return config },