fix(permission): 修复权限路由跳转逻辑
- 调整判断条件,允许未登录用户访问 /plan/tts 路径 - 防止未登录时强制跳转到登录页,提升用户体验 - 修正 application-dev.yml 中 speech 配置缩进问题,保证配置正确解析
This commit is contained in:
@@ -10,13 +10,17 @@ router.beforeEach((to, from, next) => {
|
||||
// 展示页面加载 Loading
|
||||
showPageLoading()
|
||||
const token = getToken()
|
||||
if (!token && to.path !== '/login') {
|
||||
if (!token && to.path !== '/login' && to.path !== '/plan/tts') {
|
||||
next({ path: '/login' })
|
||||
return
|
||||
}
|
||||
if (token && to.path === '/login') {
|
||||
next({ path: '/class' })
|
||||
return
|
||||
}
|
||||
if (to.path === '/plan/tts') {
|
||||
next()
|
||||
return
|
||||
}
|
||||
next()
|
||||
})
|
||||
@@ -30,4 +34,3 @@ router.afterEach((to, from) => {
|
||||
// 隐藏页面加载 Loading
|
||||
hidePageLoading()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user