From bfa7d3b23e526809b04299d9c2719c3449aba3be Mon Sep 17 00:00:00 2001
From: longz <longzhaoz@qq.com>
Date: 星期二, 28 四月 2026 10:32:42 +0800
Subject: [PATCH] 小程序图片压缩
---
yuyueMiniProgram/src/pages/mine/index.vue | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/yuyueMiniProgram/src/pages/mine/index.vue b/yuyueMiniProgram/src/pages/mine/index.vue
index 2ef937c..8ed955b 100644
--- a/yuyueMiniProgram/src/pages/mine/index.vue
+++ b/yuyueMiniProgram/src/pages/mine/index.vue
@@ -24,6 +24,7 @@
const navBarHeight = 44
const profile = computed(() => authStore.profile)
+const isLoggedIn = computed(() => authStore.isLoggedIn)
const userRole = computed<'employee' | 'normal'>(() => profile.value?.userType === 'EMPLOYEE' ? 'employee' : 'normal')
const roleLabel = computed(() => {
if (userRole.value === 'employee') {
@@ -49,6 +50,10 @@
const visibleMenus = computed(() => menuList.value.filter(item => item.showFor.includes(userRole.value)))
function handleEditProfile() {
+ if (!isLoggedIn.value) {
+ authStore.showLoginPrompt('您还未登录,请先登录')
+ return
+ }
uni.navigateTo({ url: '/pages/profile/index' })
}
@@ -61,11 +66,15 @@
}
finally {
authStore.clearSession()
- router.replaceAll({ name: 'login' })
+ router.replaceAll({ name: 'home' })
}
}
function handleMenuClick(item: MenuItem) {
+ if (!isLoggedIn.value) {
+ authStore.showLoginPrompt('您还未登录,请先登录')
+ return
+ }
if (item.title === '退出登录') {
void handleLogout()
return
--
Gitblit v1.7.1