From 26a0a54bd5f2312fc4bba9c78c2ecb7766809ae0 Mon Sep 17 00:00:00 2001 From: Rewrite0 <49576640+Rewrite0@users.noreply.github.com> Date: Wed, 31 May 2023 22:05:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9token=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/axios.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/axios.ts b/src/utils/axios.ts index 85eb0d7c..d1f591cd 100644 --- a/src/utils/axios.ts +++ b/src/utils/axios.ts @@ -25,7 +25,8 @@ axios.interceptors.response.use( detail, }; - if (error.detail === 'Not authenticated') { + /** token 过期 */ + if (error.status === 401) { const { auth } = useAuth(); auth.value = ''; }