From cbb23429b8beed72b58cbb57f9b3c56a0fb2b5d2 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 09 五月 2025 13:31:26 +0800 Subject: [PATCH] 修改 --- src/utils/request.ts | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils/request.ts b/src/utils/request.ts index ed8cf58..10500ec 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -15,13 +15,13 @@ service.interceptors.request.use( (config) => { - for (let key in config.data) { - if (config.data[key] == '' && config.data[key] !== 0) { - config.data[key] = null; - } - } + // for (let key in config.data) { + // if (config.data[key] == '' && config.data[key] !== 0) { + // config.data[key] = null; + // } + // } if (Cookies.get('token')) { - (<any>config.headers).common['Authorization'] = `${Cookies.get('token')}`; + (<any>config.headers).common['tk'] = `${Cookies.get('token')}`; (<any>config.headers).common['uid'] = `${Cookies.get('uid')}`; } return config; @@ -63,7 +63,7 @@ Session.clear(); window.location.href = '/'; }); - } else if (response.data.code && response.data.code === 'A0215') { + } else if (response.data.code && response.data.code === 405) { ElMessage.error('token失效'); // logOut; useLoginApi() -- Gitblit v1.9.2