From dd4f70073cc6a718e600f0c1517d405130306692 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Sun, 25 Nov 2018 17:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/axios/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugin/axios/index.js b/src/plugin/axios/index.js index 68fd19a4b..fa35dc8e0 100644 --- a/src/plugin/axios/index.js +++ b/src/plugin/axios/index.js @@ -41,13 +41,9 @@ const service = axios.create({ service.interceptors.request.use( config => { // 在请求发送之前做一些处理 - if (!(/^https:\/\/|http:\/\//.test(config.url))) { - const token = util.cookies.get('token') - if (token && token !== 'undefined') { - // 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改 - config.headers['X-Token'] = token - } - } + const token = util.cookies.get('token') + // 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改 + config.headers['X-Token'] = token return config }, error => {