fix 修复重新登录没有刷新菜单的问题
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { api } from '@/common/api'
|
||||
import { token } from '@/common/token'
|
||||
import { GLOBAL_INFO_KEY } from '@/common/storage'
|
||||
import { GLOBAL_INFO_KEY, APP_MENU_KEY } from '@/common/storage'
|
||||
import { encryptByDES, decryptByDES } from '@/util/des'
|
||||
import app from '@/main'
|
||||
|
||||
@@ -50,6 +50,7 @@ const doLogout = () => {
|
||||
if (success) {
|
||||
removeGlobal()
|
||||
token.value = ''
|
||||
window.localStorage.removeItem(APP_MENU_KEY)
|
||||
if (app.$route.path === '/') {
|
||||
app.$router.replace('/login')
|
||||
} else {
|
||||
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
return (
|
||||
<a-sub-menu key={menu.id}>
|
||||
<span slot="title">
|
||||
{menu.meta.icon ? <a-icon type={menu.meta.icon} /> : null}
|
||||
{menu.meta.icon && <a-icon type={menu.meta.icon} />}
|
||||
<span>{menu.meta.title}</span>
|
||||
</span>
|
||||
{this.renderMenu(menu.children)}
|
||||
@@ -43,7 +43,7 @@ export default {
|
||||
renderMenuItem(menu) {
|
||||
return (
|
||||
<a-menu-item key={menu.id} onClick={() => this.onOpenContentWindow(menu)}>
|
||||
{menu.meta.icon ? <a-icon type={menu.meta.icon} /> : null}
|
||||
{menu.meta.icon && <a-icon type={menu.meta.icon} />}
|
||||
<span>{menu.meta.title}</span>
|
||||
</a-menu-item>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user