src/axios/index.js
@@ -21,6 +21,7 @@ // 在ajax发送之前拦截 比如对所有请求统一添加header token axios.interceptors.request.use( config => { config.headers["lang"] = localStorage.getItem("language") ? localStorage.getItem("language") : "zh-CN"; if (window.localStorage.getItem("USERTOKEN")) { // config.headers.Authorization = `USER_TOKEN = ${store.state.token}`; config.headers["USERTOKEN"] = window.localStorage.getItem("USERTOKEN");