From cc3e08bda13360c88b7189e8f8d043b60783c7fb Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期四, 21 十一月 2024 16:46:32 +0800
Subject: [PATCH] 新增

---
 src/layout/components/Sidebar/Logo.vue |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue
index f8239d1..6beb78c 100644
--- a/src/layout/components/Sidebar/Logo.vue
+++ b/src/layout/components/Sidebar/Logo.vue
@@ -1,11 +1,11 @@
 <template>
   <div class="sidebar-logo-container" :class="{ 'collapse': collapse }" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
     <transition name="sidebarLogoFade">
-      <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" :to="firstPage">
+      <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" :to="permissionStore.indexPage">
         <img v-if="logo" :src="logo" class="sidebar-logo" />
         <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1>
       </router-link>
-      <router-link v-else key="expand" class="sidebar-logo-link" :to="firstPage">
+      <router-link v-else key="expand" class="sidebar-logo-link" :to="permissionStore.indexPage">
         <img v-if="logo" :src="logo" class="sidebar-logo" />
         <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1>
       </router-link>
@@ -17,20 +17,14 @@
 import variables from '@/assets/styles/variables.module.scss'
 import logo from '@/assets/logo/logo2.png'
 import useSettingsStore from '@/store/modules/settings'
-import {onMounted, ref} from "vue";
-import Cookies from "js-cookie";
+import usePermissionStore from '@/store/modules/permission'
 defineProps({
   collapse: {
     type: Boolean,
     required: true
   }
 })
-const firstPage = ref("");
-onMounted(() => {
-    const routers = JSON.parse(Cookies.get('routers')) ;
-    firstPage.value = routers[0].path;
-
-});
+const permissionStore = usePermissionStore()
 const title = import.meta.env.VITE_APP_TITLE;
 const settingsStore = useSettingsStore();
 const sideTheme = computed(() => settingsStore.sideTheme);
@@ -63,7 +57,7 @@
       width: 32px;
       height: 32px;
       vertical-align: middle;
-      margin-right: 8px;
+      margin-right: 12px;
     }
 
     & .sidebar-title {
@@ -72,7 +66,7 @@
       color: #fff;
       font-weight: 600;
       line-height: 50px;
-      font-size: 16px;
+      font-size: 14px;
       font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
       vertical-align: middle;
     }
@@ -84,4 +78,4 @@
     }
   }
 }
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.2