perf: 登录逻辑调整

This commit is contained in:
rd
2025-09-11 12:04:54 +08:00
parent 44e1ea9a06
commit 7e6e086098
11 changed files with 103 additions and 104 deletions

View File

@ -1,16 +1,14 @@
<template>
<div class="navbar-wrap px-24px">
<div class="w-full h-full relative flex justify-between">
<div class="left-wrap flex items-center cursor-pointer" @click="onLogoClick">
<img src="@/assets/img/icon-logo.png" alt="" width="96" height="24"/>
<img src="@/assets/img/icon-logo.png" alt="" width="96" height="24" />
</div>
<!-- <div class="flex-1"> -->
<MiddleSide v-if="!isHomeRoute"/>
<MiddleSide v-if="!isHomeRoute" />
<!-- </div> -->
<RightSide :isAgentRoute="isAgentRoute" v-if="userStore.isLogin"/>
<RightSide :isAgentRoute="isAgentRoute" v-if="userStore.isLogin" />
</div>
</div>
</template>
@ -19,13 +17,15 @@ import MiddleSide from './components/middle-side';
import RightSide from './components/right-side';
import { useUserStore } from '@/stores';
import { useEnterpriseStore } from '@/stores/modules/enterprise';
import { handleUserHome } from '@/utils/user.ts';
import router from '@/router';
const route = useRoute();
const userStore = useUserStore();
const enterpriseStore = useEnterpriseStore();
const hasOpenEnterprise = computed(() => userStore.isOpenEnterprise);
const hasOpenEnterprise = computed(() => enterpriseStore.isOpenEnterprise);
const isAgentRoute = computed(() => {
return route.meta?.isAgentRoute;
});
@ -39,8 +39,8 @@ const onLogoClick = () => {
handleUserHome();
} else {
router.push({
name: 'Trial'
})
name: 'Trial',
});
}
};
</script>