fix 修复重新登录没有刷新菜单的问题

This commit is contained in:
2021-04-25 20:57:10 +08:00
parent ccb0078a79
commit a150ef64cf
2 changed files with 4 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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>
)