Commit c16b48eb authored by levante's avatar levante

123

parent 5fb9ccdc
......@@ -24,17 +24,16 @@
</div>
<div>
<!-- <a-badge :count="0" showZero><a><a-icon type="bell" /></a></a-badge> -->
<!-- <a-dropdown class="navdropmenu" style="margin-right:20px;">
<a-dropdown class="navdropmenu" style="margin-right:20px;">
<span>
<a-icon type="user" />
<span class="name">{{username}}</span>
<a-icon type="down" />
</span>
<a-menu slot="overlay" @click="handleClick">
<a-menu-item key="changePwd" @click="showChangePwdModal">修改密码</a-menu-item>
<a-menu-item key="2">退出登录</a-menu-item>
</a-menu>
</a-dropdown> -->
</a-dropdown>
</div>
</a-layout-header>
<a-layout-content class="layout-content">
......
......@@ -12,4 +12,17 @@ const router = new Router({
routes,
})
router.beforeEach((to, from, next) => {
// TODO
store.commit('setWebviewSrc', to.meta && to.meta.src) // 判断有src的话为需要嵌入iframe的子项目
const token = Cookie.get('token')
// 当前无token且不在login页面则推到登录页面
if (to.path != '/login' && !token) {
next('/login')
} else {
next()
}
})
export default router
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment