1
This commit is contained in:
@@ -44,19 +44,14 @@ const app = new Vue({
|
||||
console.log('框架版本:', AdminFramework.version)
|
||||
console.log('配置信息:', this.$config)
|
||||
|
||||
// 设置系统标题
|
||||
await this.$store.dispatch('app/getSysTitle', {
|
||||
defaultTitle: this.$config.title,
|
||||
defaultLogo: ''
|
||||
})
|
||||
|
||||
// 刷新时恢复菜单
|
||||
// 刷新时恢复菜单和标题
|
||||
const token = this.$store.state.user.token
|
||||
const authorityMenus = localStorage.getItem('authorityMenus')
|
||||
|
||||
if (token && authorityMenus) {
|
||||
console.log('检测到登录状态,恢复菜单...')
|
||||
console.log('检测到登录状态,恢复菜单和标题...')
|
||||
try {
|
||||
// 先恢复菜单
|
||||
await this.$store.dispatch('user/setAuthorityMenus', {
|
||||
Main: AdminFramework.Main,
|
||||
ParentView: AdminFramework.ParentView,
|
||||
@@ -64,9 +59,19 @@ const app = new Vue({
|
||||
authorityMenus: authorityMenus
|
||||
})
|
||||
console.log('菜单恢复成功')
|
||||
|
||||
// 再获取系统标题(已登录,会从接口获取)
|
||||
await this.$store.dispatch('app/getSysTitle', {
|
||||
defaultTitle: this.$config.title,
|
||||
defaultLogo: ''
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('恢复菜单失败:', error)
|
||||
console.error('恢复失败:', error)
|
||||
}
|
||||
} else {
|
||||
// 未登录,使用默认标题
|
||||
console.log('未登录,使用默认标题')
|
||||
document.title = this.$config.title
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user