From 391509b7666c4165573295d652b1c0e33072788a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E6=AC=A7=EF=BC=88=E6=9E=97=E5=B9=B3=E5=87=A1?= =?UTF-8?q?=EF=BC=89?= Date: Fri, 19 Sep 2025 18:04:46 +0800 Subject: [PATCH] 1 --- src/router/index.js | 5 ++--- src/views/login.vue | 18 +----------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index d850ab5..9d1dbfb 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -62,9 +62,8 @@ export const constantRoutes = [ hidden: true }, { - path: '', - component: Layout, - redirect: '/sloworder/index' + path: '/', + redirect: '/user/profile' }, { path: '/user', diff --git a/src/views/login.vue b/src/views/login.vue index 6d69f8b..c86ed67 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -142,23 +142,7 @@ export default { Cookies.remove('rememberMe') } this.$store.dispatch("Login", this.loginForm).then(() => { - // 获取用户信息和生成路由后再跳转 - this.$store.dispatch('GetInfo').then(() => { - this.$store.dispatch('GenerateRoutes').then(() => { - // 使用 nextTick 确保路由添加完成 - this.$nextTick(() => { - // 检查是否有慢单权限 - if (this.$auth.hasPermi('jdorder:sloworder:list')) { - this.$router.push({ path: this.redirect || "/sloworder/index" }).catch(()=>{}) - } else { - // 如果没有慢单权限,跳转到用户个人中心 - this.$router.push({ path: this.redirect || "/user/profile" }).catch(()=>{}) - } - }) - }) - }).catch(() => { - this.$router.push({ path: this.redirect || "/user/profile" }).catch(()=>{}) - }) + this.$router.push({ path: this.redirect || "/sloworder/index" }).catch(()=>{}) }).catch(() => { this.loading = false if (this.captchaEnabled) {