feat: 重构sidebar菜单块逻辑
This commit is contained in:
@ -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();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user