fix(permission): 修复权限路由跳转逻辑

- 调整判断条件,允许未登录用户访问 /plan/tts 路径
- 防止未登录时强制跳转到登录页,提升用户体验
- 修正 application-dev.yml 中 speech 配置缩进问题,保证配置正确解析
This commit is contained in:
lbw
2025-12-30 11:59:47 +08:00
parent 0f5169c1d7
commit 6277e3ab42
2 changed files with 9 additions and 6 deletions

View File

@@ -24,10 +24,10 @@ spring:
api-key: your_api_key_here
base-url: http://124.220.58.5:2233
audio:
speech:
options:
model: tts-1
voice: alloy
speech:
options:
model: tts-1
voice: alloy
templates:

View File

@@ -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()
})