From 24bcaf2a28b6126d33c50609389bf0da737e8a62 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 8 Mar 2021 13:43:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A3=80=E6=B5=8B=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/request.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/utils/request.js b/web/src/utils/request.js index 576591dd..640985d6 100644 --- a/web/src/utils/request.js +++ b/web/src/utils/request.js @@ -65,7 +65,7 @@ service.interceptors.response.use( if (response.headers["new-token"]) { store.commit('user/setToken', response.headers["new-token"]) } - if (response.data.code == 0 || response.headers.success === "true") { + if(response.data.code == 0){ if(response.data.data.needInit){ Message({ type:"info", @@ -74,6 +74,8 @@ service.interceptors.response.use( store.commit("user/NeedInit") router.push({name:"init"}) } + } + if (response.data.code == 0 || response.headers.success === "true") { return response.data } else { Message({