This commit is contained in:
雷欧(林平凡)
2025-09-19 18:04:46 +08:00
parent f33e6be27d
commit 391509b766
2 changed files with 3 additions and 20 deletions

View File

@@ -62,9 +62,8 @@ export const constantRoutes = [
hidden: true hidden: true
}, },
{ {
path: '', path: '/',
component: Layout, redirect: '/user/profile'
redirect: '/sloworder/index'
}, },
{ {
path: '/user', path: '/user',

View File

@@ -142,23 +142,7 @@ 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 || "/sloworder/index" }).catch(()=>{})
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(()=>{})
})
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
if (this.captchaEnabled) { if (this.captchaEnabled) {