From cc7f03bcbb427ce334f6935311d22f36a61c21fd Mon Sep 17 00:00:00 2001 From: 鲁班七号 <9159450+luban-71@user.noreply.gitee.com> Date: 星期四, 20 七月 2023 11:52:48 +0800 Subject: [PATCH] 修改“我发布的”,为本级发出 --- src/util/request.js | 24 +++++++++++------------- 1 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/util/request.js b/src/util/request.js index 2fb29a4..74f0b2f 100644 --- a/src/util/request.js +++ b/src/util/request.js @@ -36,25 +36,23 @@ (response) => { // 对响应数据做点什么 if (response.data.code && response.data.code === 401) { - message.error('用户不存在'); - loginOut() - .then(() => { - Session.clear(); - window.location.href = '/'; - }); - // useLoginApi() - // .signOut() - // .then(() => { - // Session.clear(); - // window.location.href = '/'; - // }); + // 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