From 2591d9565cda1c392a630ddfd988952c7ae65cda Mon Sep 17 00:00:00 2001 From: yang <1441163367@qq.com> Date: 星期三, 28 十二月 2022 17:10:55 +0800 Subject: [PATCH] 第一版PAD --- src/router/axios.js | 36 ++++++++++++++++++------------------ 1 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/router/axios.js b/src/router/axios.js index a11ba74..b8e6bf0 100644 --- a/src/router/axios.js +++ b/src/router/axios.js @@ -34,9 +34,9 @@ const TENANT_ID = getStore({ name: 'tenantId' }) const isToken = (config.headers || {}).isToken === false const token = window.android.getAppToken() - // const token = `dd271fdb-4b69-4eb3-a940-52d70232e56b` + // const token = `59866cb8-c5ba-4b2f-a367-3ab2f64f30c5` if (token && !isToken) { - config.headers['Authorization'] = 'bearer ' + token// token + config.headers['Authorization'] = 'Bearer ' + token// token } if (TENANT_ID) { config.headers['TENANT-ID'] = TENANT_ID // 绉熸埛ID @@ -47,7 +47,7 @@ config.data = serialize(config.data) delete config.data.serialize } - config.headers['VERSION'] = 'lmm' + // config.headers['VERSION'] = 'GHX' if (config.method === 'get'||config.params) { config.paramsSerializer = function (params) { let p ={}; @@ -73,27 +73,27 @@ // loadingInstance.close(); const status = Number(res.status) || 200 const message = res.data.msg || errorCode[status] || errorCode['default'] - /* if (status === 401) { - // Message({ - // message: message, - // type: 'error' - // }) + /*if (status === 401) { + Message({ + message: message, + type: 'error' + }) handleError(message) store.dispatch('FedLogOut').then(() => { - router.push({ path: '/login' }) + router.push({ path: '/pad' }) }) return }*/ - // if (status !== 200 || res.data.code === 1) { - // // Message({ - // // message: message, - // // type: 'error' - // // }) - // // handleError(message) - // return handleError(message) - // // return Promise.reject(new Error(message)) - // } + /*if (status !== 200 || res.data.code === 1) { + Message({ + message: message, + type: 'error' + }) + handleError(message) + return handleError(message) + // return Promise.reject(new Error(message)) + }*/ return res }, error => { NProgress.done() -- Gitblit v1.9.1