From f33e6be27dc50c4072a44a6c0b21522b613fea65 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 17:39:56 +0800 Subject: [PATCH] 1 --- src/views/login.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/views/login.vue b/src/views/login.vue index eb5ae72..6d69f8b 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -145,7 +145,16 @@ export default { // 获取用户信息和生成路由后再跳转 this.$store.dispatch('GetInfo').then(() => { this.$store.dispatch('GenerateRoutes').then(() => { - this.$router.push({ path: this.redirect || "/sloworder/index" }).catch(()=>{}) + // 使用 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(()=>{})