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