修复两处错误
This commit is contained in:
@ -29,7 +29,7 @@ const toHome = () => router.push({ path: '/' })
|
|||||||
<AntDesignOutlined />
|
<AntDesignOutlined />
|
||||||
<span style="margin-left: 12px">{{ title }}</span>
|
<span style="margin-left: 12px">{{ title }}</span>
|
||||||
</div>
|
</div>
|
||||||
<AMenu :items="systemStore.fmtMenus()" mode="inline" theme="dark" @select="selectMenu" />
|
<AMenu :items="systemStore.fmtMenus" mode="inline" theme="dark" @select="selectMenu" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -25,6 +25,13 @@ export const useSystemStore = defineStore('system', {
|
|||||||
isLogin(state) {
|
isLogin(state) {
|
||||||
return !!state.token
|
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: {
|
actions: {
|
||||||
// 解析令牌
|
// 解析令牌
|
||||||
@ -54,14 +61,6 @@ export const useSystemStore = defineStore('system', {
|
|||||||
axios.get('/manager/own/menus').then(([_, res]) => (this.menus = res.data || []))
|
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() {
|
init() {
|
||||||
this.parseToken()
|
this.parseToken()
|
||||||
|
Reference in New Issue
Block a user