From d99993a2f0e73b4d8d47b5475da866194bbe805b Mon Sep 17 00:00:00 2001 From: woody Date: Mon, 18 Aug 2025 09:35:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(request):=20=E8=8E=B7=E5=8F=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3500=E6=97=B6?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/request.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/request.js b/config/request.js index 2d42436..aea9ad8 100644 --- a/config/request.js +++ b/config/request.js @@ -51,6 +51,7 @@ module.exports = vm => { // 响应拦截 uni.$u.http.interceptors.response.use( response => { + console.log(response, '......response') const data = response.data // uni.$u.toast(data.msg) // if (data.code == 200) { @@ -71,6 +72,20 @@ module.exports = vm => { }) }, 1500) } else if (data.code == 500) { + if (['/member/api/member/get-info'].includes(response?.config?.url)) { + uni.showToast({ + title: '登录失败', + icon: 'none', + duration: 800, + }) + setTimeout(() => { + uni.reLaunch({ + url: '/pages/login/index', + }) + }, 800) + removeToken() + return data + } uni.$u.toast(data.msg) return data } else {