perf: 避免每次路由都去初始化网站配置

This commit is contained in:
Bull-BCLS
2024-04-15 23:20:22 +08:00
parent 05f4580609
commit 721b30e185
2 changed files with 7 additions and 5 deletions

View File

@@ -1,14 +1,17 @@
<template>
<section class="system-logo" :class="{ collapsed: props.collapsed }" @click="toHome">
<img class="logo" :src="appStore.getLogo() ?? '@/assets/images/logo.svg'" alt="logo"/>
<span class="system-name">{{ appStore.getTitle() }}</span>
<span class="system-name">{{ webTitle }}</span>
</section>
</template>
<script setup lang="ts">
import { useAppStore } from '@/stores'
import {useAppStore} from "@/stores";
const appStore = useAppStore()
const appStore= useAppStore();
appStore.initWebConfig()
const webTitle = computed(() => appStore.getTitle());
interface Props {
collapsed?: boolean

View File

@@ -16,7 +16,6 @@ router.beforeEach(async (to, from, next) => {
const userStore = useUserStore()
const routeStore = useRouteStore()
const appStore = useAppStore()
appStore.initWebConfig()
// 判断该用户是否登录
if (getToken()) {