From f306788d8c6ec006d9347c2d48dfcb54ff8f000c Mon Sep 17 00:00:00 2001
From: "34701892@qq.com" <34701892@qq.com>
Date: Sun, 17 Aug 2025 18:57:49 +0800
Subject: [PATCH] =?UTF-8?q?refactor(=E7=99=BB=E5=BD=95=E6=B5=81=E7=A8=8B):?=
=?UTF-8?q?=20=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95=E9=80=80=E5=87=BA?=
=?UTF-8?q?=E9=80=BB=E8=BE=91=E5=92=8C=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将 mine.vue 和 mineMini.vue 的退出登录逻辑简化为清除存储并触发事件
- 修改登录成功后的跳转方式为 redirectTo 避免页面堆叠
- 移除 Tabbar.vue 中多余的"全部"选项
- 在 minihome/index.vue 中处理退出登录后的 tab 切换
- 默认展开 RankListMini 并移除展开/收起功能
---
src/components/RankListMini.vue | 6 +++---
src/components/mine.vue | 1 +
src/components/mineMini.vue | 16 ++++------------
src/components/mini/Tabbar.vue | 7 -------
src/pages/login/indexMini.vue | 5 ++---
src/pages/minihome/index.vue | 2 +-
6 files changed, 11 insertions(+), 26 deletions(-)
diff --git a/src/components/RankListMini.vue b/src/components/RankListMini.vue
index 7b45acd..b137154 100644
--- a/src/components/RankListMini.vue
+++ b/src/components/RankListMini.vue
@@ -35,12 +35,12 @@
-
+
@@ -53,7 +53,7 @@ import dayjs from "dayjs/esm/index";
import LoginPopup from "@/components/loginPopup/index.vue";
import { Session } from "@/utils/storage";
-const isExp = ref(false);
+const isExp = ref(true);
const rankListLocal = ref([]);
const loading = ref(true);
diff --git a/src/components/mine.vue b/src/components/mine.vue
index 852bb1a..480cbf5 100644
--- a/src/components/mine.vue
+++ b/src/components/mine.vue
@@ -149,6 +149,7 @@ const loginOut = () => {
uni.reLaunch({
url: "/pages/login/index",
});
+
};
const handleClick = (val: number) => {
diff --git a/src/components/mineMini.vue b/src/components/mineMini.vue
index 0d5cdb8..8d12aa1 100644
--- a/src/components/mineMini.vue
+++ b/src/components/mineMini.vue
@@ -93,6 +93,8 @@ import LoginPopup from "@/components/loginPopup/index.vue";
import { useShareStore } from "@/stores/shareStore";
import Navbar from '@/components/mini/Navbar.vue'
+const emit = defineEmits(['logout'])
+
const stores = useShareStore();
const curPages = getCurrentPages();
@@ -150,18 +152,8 @@ const loginBtnStatus = () => {
// 退出登录,回到登录页面
const loginOut = () => {
- uni.showToast({
- title: "退出登录",
- icon: "none",
- duration: 1500,
- });
- // 清除 cookie
- Session.clear();
- uni.removeStorageSync("subStatus");
- uni.removeStorageSync("tabValue");
- uni.reLaunch({
- url: "/pages/login/index",
- });
+ uni.clearStorageSync()
+ emit("logout")
};
const handleClick = (val: number) => {
diff --git a/src/components/mini/Tabbar.vue b/src/components/mini/Tabbar.vue
index 429e3d4..3aaca59 100644
--- a/src/components/mini/Tabbar.vue
+++ b/src/components/mini/Tabbar.vue
@@ -17,13 +17,6 @@
-
-
-
- 全部
-