解决登录显示、首页显示bug

This commit is contained in:
2026-05-19 11:06:46 +08:00
parent 2f7e097e6c
commit 00a859c551
181 changed files with 55329 additions and 998 deletions

View File

@@ -152,12 +152,22 @@ export function responsiveState() {
export function goToLogin(redirectUrl?: string | null) {
try {
const target = redirectUrl != null && redirectUrl.length > 0 ? redirectUrl : ''
if (target.length > 0) {
const redirect = encodeURIComponent(target)
uni.navigateTo({ url: `/pages/user/login?redirect=${redirect}` })
} else {
uni.navigateTo({ url: '/pages/user/login' })
}
uni.showModal({
title: '提示',
content: '当前操作需要登录,是否前往登录页继续?',
confirmText: '去登录',
cancelText: '先逛逛',
success: (res) => {
if (res.confirm) {
if (target.length > 0) {
const redirect = encodeURIComponent(target)
uni.navigateTo({ url: `/pages/user/login?redirect=${redirect}` })
} else {
uni.navigateTo({ url: '/pages/user/login' })
}
}
}
})
} catch (e) {
uni.navigateTo({ url: '/pages/user/login' })
}