feat: 产品菜单路由权限

This commit is contained in:
rd
2025-07-08 16:55:04 +08:00
parent ead209da4d
commit f87e5ff020
26 changed files with 263 additions and 102 deletions

View File

@ -8,6 +8,7 @@
<script setup lang="ts">
import { useUserStore } from '@/stores';
import { useEnterpriseStore } from '@/stores/modules/enterprise';
import { useSidebarStore } from '@/stores/modules/side-bar';
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
@ -20,14 +21,18 @@ const redTheme = {
colorLink: '#f5222d', // 链接色
},
};
// 初始化企业信息
const init = async () => {
const { isLogin, fetchUserInfo } = userStore;
const { updateEnterpriseInfo } = enterpriseStore;
const { isLogin, getUserInfo } = userStore;
const { getUserEnterpriseInfo } = enterpriseStore;
const sidebarStore = useSidebarStore();
if (isLogin) {
await fetchUserInfo();
await updateEnterpriseInfo();
await getUserInfo(); // 初始化用户信息
await getUserEnterpriseInfo(); // 初始化企业信息
sidebarStore.getUserNavbarMenuList(); // 初始化navbar菜单
userStore.getUserAllowAccessRoutes(); // 初始化允许访问的路由
}
};