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