refactor(user): 重构用户信息获

This commit is contained in:
rd
2025-09-19 09:40:06 +08:00
parent 55b4ed1e83
commit 192a125d01
6 changed files with 21 additions and 12 deletions

View File

@ -8,18 +8,20 @@
<script setup>
import { useUserStore } from '@/stores';
// import { useChatStore } from '@/stores/modules/chat';
import { initApp } from '@/utils/user';
import { useRoute } from 'vue-router';
import { handleUserHome, initApp } from '@/utils/user';
import { useSidebarStore } from '@/stores/modules/side-bar';
import { useEnterpriseStore } from '@/stores/modules/enterprise';
import { ConfigProvider } from 'ant-design-vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import 'dayjs/locale/zh-cn';
const userStore = useUserStore();
// const route = useRoute();
const route = useRoute();
const sidebarStore = useSidebarStore();
// const chatStore = useChatStore();
const enterpriseStore = useEnterpriseStore();
const redTheme = {
token: {
@ -34,6 +36,10 @@ const init = async () => {
// 已开通
if (isLogin) {
await initApp();
if (enterpriseStore.isOpenEnterprise && route.name === 'Trial') {
handleUserHome();
}
} else {
sidebarStore.stopUnreadInfoPolling();
}