更改首页显示

This commit is contained in:
15066119699 2025-03-05 14:52:33 +08:00
parent 3cbe53d458
commit 25be0bbc20
3 changed files with 24 additions and 10 deletions

View File

@ -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 = "/") {

View File

@ -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' }
}
]
},

View File

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