feat(request): 获取用户信息失败时返回登录页面

This commit is contained in:
woody 2025-09-16 14:35:21 +08:00
parent 1a2668f728
commit b3c7456503
1 changed files with 14 additions and 0 deletions

View File

@ -78,6 +78,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 {