From 58b1677251e02a72483b8dea38b69b7f9e03060f Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 17 Dec 2021 19:53:42 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20token=20=E5=A4=B1=E6=95=88=E6=9C=AA?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E6=B8=85=E9=99=A4=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=80=81=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/axios.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/axios.js b/plugins/axios.js index d566a52..66c47c0 100644 --- a/plugins/axios.js +++ b/plugins/axios.js @@ -22,19 +22,19 @@ export default function ({app, $axios, store, redirect}) { if (response.data.success) { resolve(response.data); } else { - if (response.data.code === '0') { + if (response.data.code === 0) { Message.error(message ? message : '服务异常') - } else if (response.data.code === '401') { + } else if (response.data.code === 401) { Cookie.remove('auth'); store.commit('setAuth', null); window.location.reload() - } else if (response.data.code === '402') { + } else if (response.data.code === 402) { Cookie.remove('auth'); store.commit('setAuth', null); window.location.reload() - } else if (response.data.code === '404') { + } else if (response.data.code === 404) { Message.error('操作失败,请稍后再试......') - } else if (response.data.code === '500') { + } else if (response.data.code === 500) { Message.error('服务器正在开小差,请稍后再试......') } else { Message.error(response.data.message);