From 25be0bbc203f1b1ed96d37a46280914ab1f70851 Mon Sep 17 00:00:00 2001 From: 15066119699 Date: Wed, 5 Mar 2025 14:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=A6=96=E9=A1=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Breadcrumb/index.vue | 6 +++--- src/router/index.js | 25 +++++++++++++++++++------ src/views/login.vue | 3 ++- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 080595a..7fbbd42 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -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 = "/") { diff --git a/src/router/index.js b/src/router/index.js index 71907b6..9bbdf96 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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' } } ] }, diff --git a/src/views/login.vue b/src/views/login.vue index 65de6fc..0c9e3e5 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -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) {