From 7c906b4acf785180132f91db5d70c3a29fa85cd3 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Wed, 21 Jun 2023 09:39:13 +0800
Subject: [PATCH] 新增页面和配置,对接口
---
src/util/request.js | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/util/request.js b/src/util/request.js
index 34ba6b5..74f0b2f 100644
--- a/src/util/request.js
+++ b/src/util/request.js
@@ -35,21 +35,24 @@
http.interceptors.response.use(
(response) => {
// 对响应数据做点什么
- if (response.data.code && response.data.code === 'A0213') {
- message.error('用户uid不存在');
- // useLoginApi()
- // .signOut()
- // .then(() => {
- // Session.clear();
- // window.location.href = '/';
- // });
+ if (response.data.code && response.data.code === 401) {
+ // message.error('用户不存在')
+ setTimeout(()=>{
+ loginOut()
+ .then(() => {
+ Session.clear();
+ window.location.href = '/';
+ });
+ },2000)
} else if (response.data.code && response.data.code === 405) {
- message.error('token失效');
+ message.error('token失效')
+ setTimeout(()=>{
loginOut()
.then(() => {
Session.clear();
window.location.href = '/';
});
+ },2000)
}
return Promise.resolve(response);
},
--
Gitblit v1.9.2