This commit is contained in:
2026-01-18 18:03:40 +08:00
parent f038dbab41
commit 9259bda54b
7 changed files with 40 additions and 12 deletions

View File

@@ -92,10 +92,24 @@ export function checkLogin() {
// 未登录,跳转到登录页
if (currentRoute !== '/pages/ucenter/login/index') {
// 保存当前页面路径,登录后可以返回
const pages = getCurrentPages()
if (pages && pages.length > 0) {
const currentPage = pages[pages.length - 1]
try {
uni.setStorageSync('beforLoginUrl', {
route: currentPage.route,
options: currentPage.options
})
} catch (e) {
console.error('保存登录前页面失败:', e)
}
}
uni.showToast({
title: '请先登录',
icon: 'none',
duration: 2000
duration: 1500
})
setTimeout(() => {