mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-08 22:57:11 +08:00
perf: 避免每次路由都去初始化网站配置
This commit is contained in:
@@ -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>
|
||||
<img class="logo" :src="appStore.getLogo() ?? '@/assets/images/logo.svg'" alt="logo"/>
|
||||
<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
|
||||
|
@@ -16,7 +16,6 @@ router.beforeEach(async (to, from, next) => {
|
||||
const userStore = useUserStore()
|
||||
const routeStore = useRouteStore()
|
||||
const appStore = useAppStore()
|
||||
appStore.initWebConfig()
|
||||
|
||||
// 判断该用户是否登录
|
||||
if (getToken()) {
|
||||
|
Reference in New Issue
Block a user