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