Compare commits
2 Commits
d7c20310ee
...
7b9b72e815
Author | SHA1 | Date | |
---|---|---|---|
7b9b72e815
|
|||
361d69648e
|
@ -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>
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user