更改首页显示
This commit is contained in:
parent
3cbe53d458
commit
25be0bbc20
|
|
@ -46,9 +46,9 @@ export default {
|
|||
matched = router.matched.filter(item => item.meta && item.meta.title)
|
||||
}
|
||||
// 判断是否为首页
|
||||
if (!this.isDashboard(matched[0])) {
|
||||
matched = [{ path: "/index", meta: { title: "首页" } }].concat(matched)
|
||||
}
|
||||
// if (!this.isDashboard(matched[0])) {
|
||||
// matched = [{ path: "/index", meta: { title: "首页" } }].concat(matched)
|
||||
// }
|
||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
||||
},
|
||||
findPathNum(str, char = "/") {
|
||||
|
|
|
|||
|
|
@ -61,16 +61,29 @@ export const constantRoutes = [
|
|||
component: () => import('@/views/error/401'),
|
||||
hidden: true
|
||||
},
|
||||
// {
|
||||
// path: '',
|
||||
// component: Layout,
|
||||
// redirect: 'index',
|
||||
// children: [
|
||||
// {
|
||||
// path: 'index',
|
||||
// component: () => import('@/views/index'),
|
||||
// name: 'Index',
|
||||
// meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '',
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
redirect: '/system/stock', // 修改重定向路径
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
path: 'system/stock',
|
||||
component: () => import('@/views/system/stock/index'), // 修改首页组件路径
|
||||
name: 'StockHome',
|
||||
meta: { title: '库存管理', icon: 'stock' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ export default {
|
|||
Cookies.remove('rememberMe');
|
||||
}
|
||||
this.$store.dispatch("Login", this.loginForm).then(() => {
|
||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
// this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
this.$router.push({ path: '/system/stock' }).catch(()=>{});
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
if (this.captchaEnabled) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user