From c5afbd0a600d340f7ce6bd182f30330e39b9e752 Mon Sep 17 00:00:00 2001 From: ronger Date: Tue, 11 Aug 2020 11:13:30 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=AF=B7=E6=B1=82=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=20401,402=20=E6=B8=85=E9=99=A4=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/axios.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/axios.js b/plugins/axios.js index 25b8f24..76a8a36 100644 --- a/plugins/axios.js +++ b/plugins/axios.js @@ -1,4 +1,4 @@ -// const Cookie = require('js-cookie') +const Cookie = require('js-cookie') export default function ({app, $axios, store, redirect}) { $axios.onRequest(config => { let token = store.state.oauth?.accessToken; @@ -23,10 +23,10 @@ export default function ({app, $axios, store, redirect}) { if (response.data.code === '0') { app.$message(message); } else if (response.data.code === '401') { - // Cookie.remove('auth') + Cookie.remove('auth') store.commit('setAuth', null); } else if (response.data.code === '402') { - // Cookie.remove('auth') + Cookie.remove('auth') store.commit('setAuth', null); } else if (response.data.code === '404') { app.$message('操作失败,请稍后再试......')