From 7a6939e5b956c1c803b431b51298c27e4edfa0a6 Mon Sep 17 00:00:00 2001 From: piexlmax <303176530@qq.com> Date: Fri, 31 Dec 2021 22:49:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4axios=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/request.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/utils/request.js b/web/src/utils/request.js index f386b728..ac607d9d 100644 --- a/web/src/utils/request.js +++ b/web/src/utils/request.js @@ -36,11 +36,11 @@ service.interceptors.request.use( } const token = store.getters['user/token'] const user = store.getters['user/userInfo'] - config.data = JSON.stringify(config.data) config.headers = { 'Content-Type': 'application/json', 'x-token': token, - 'x-user-id': user.ID + 'x-user-id': user.ID, + ...config.headers } return config }, @@ -70,7 +70,7 @@ service.interceptors.response.use( } else { ElMessage({ showClose: true, - message: response.data.msg||decodeURI(response.headers.msg), + message: response.data.msg || decodeURI(response.headers.msg), type: 'error' }) if (response.data.data && response.data.data.reload) {