feat: 重构sidebar菜单块逻辑

This commit is contained in:
rd
2025-07-07 18:17:31 +08:00
parent 0fe45bb2b3
commit bd4c338f35
11 changed files with 163 additions and 122 deletions

View File

@ -1,4 +1,5 @@
import { fetchEnterpriseInfo } from '@/api/all/login';
import { useSidebarStore } from '@/stores/modules/side-bar';
interface EnterpriseInfo {
id: number;
@ -7,6 +8,7 @@ interface EnterpriseInfo {
used_update_name_count: number;
sub_account_quota: number;
used_sub_account_count: number;
permissions: string[];
}
interface EnterpriseState {
@ -55,10 +57,13 @@ export const useEnterpriseStore = defineStore('enterprise', {
return this.enterpriseInfo;
},
async updateEnterpriseInfo() {
const sidebarStore = useSidebarStore();
const res = await fetchEnterpriseInfo(this.enterpriseInfo!.id);
const { code, data } = res;
if (code === 200) {
this.setEnterpriseInfo(data);
sidebarStore.getNavbarMenuList();
}
},
},