Compare commits

...

2 Commits

Author SHA1 Message Date
7b9b72e815 修复两处错误 2025-05-28 08:40:36 +08:00
361d69648e 修复两处错误 2025-05-26 08:54:20 +08:00
87 changed files with 9 additions and 10 deletions

View File

@ -29,7 +29,7 @@ const toHome = () => router.push({ path: '/' })
<AntDesignOutlined />
<span style="margin-left: 12px">{{ title }}</span>
</div>
<AMenu :items="systemStore.fmtMenus()" mode="inline" theme="dark" @select="selectMenu" />
<AMenu :items="systemStore.fmtMenus" mode="inline" theme="dark" @select="selectMenu" />
</div>
</template>

View File

@ -25,6 +25,13 @@ export const useSystemStore = defineStore('system', {
isLogin(state) {
return !!state.token
},
fmtMenus(state) {
return map(fromArray(toRaw(state.menus), { parentKey: 'parentId' }), (item) => ({
key: item.path || item.value,
label: item.name,
link: item.link || '',
}))
},
},
actions: {
// 解析令牌
@ -54,14 +61,6 @@ export const useSystemStore = defineStore('system', {
axios.get('/manager/own/menus').then(([_, res]) => (this.menus = res.data || []))
}
},
// 格式化菜单
fmtMenus() {
return map(fromArray(toRaw(this.menus), { parentKey: 'parentId' }), (item) => ({
key: item.path || item.value,
label: item.name,
link: item.link || '',
}))
},
// 初始化
init() {
this.parseToken()

View File

@ -53,7 +53,7 @@ CREATE TABLE `authority`
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT =='权限表';
COLLATE = utf8mb4_general_ci COMMENT ='权限表';
INSERT INTO authority (id, parent_id, name, value, `path`, link, `type`, status, description, version, delete_time,
create_time, update_time, create_by, update_by, tenant)