1
This commit is contained in:
@@ -39,10 +39,29 @@ const app = new Vue({
|
||||
router: AdminFramework.router,
|
||||
store: AdminFramework.store,
|
||||
render: h => h('router-view'),
|
||||
created() {
|
||||
async created() {
|
||||
console.log('=== Admin Framework Demo 启动成功 ===')
|
||||
console.log('框架版本:', AdminFramework.version)
|
||||
console.log('配置信息:', this.$config)
|
||||
|
||||
// 刷新时恢复菜单
|
||||
const token = this.$store.state.user.token
|
||||
const authorityMenus = localStorage.getItem('authorityMenus')
|
||||
|
||||
if (token && authorityMenus) {
|
||||
console.log('检测到登录状态,恢复菜单...')
|
||||
try {
|
||||
await this.$store.dispatch('user/setAuthorityMenus', {
|
||||
Main: AdminFramework.Main,
|
||||
ParentView: AdminFramework.ParentView,
|
||||
Page404: AdminFramework.Page404,
|
||||
authorityMenus: authorityMenus
|
||||
})
|
||||
console.log('菜单恢复成功')
|
||||
} catch (error) {
|
||||
console.error('恢复菜单失败:', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user