fix: interview creation show real error msg instead of generic failure

- Backend: wrap AI call in try/catch, throw HttpException(503)
  with msg 'AI 服务暂时不可用,请稍后重试'
- Backend: AllExceptionsFilter preserve original error message
  for non-HttpException errors
- Frontend: handle string/object res.data, show statusCode
  as fallback when message is unavailable
This commit is contained in:
yuzhiran
2026-07-03 15:32:22 +08:00
parent bd398f154a
commit 59fc35dad9
3 changed files with 17 additions and 8 deletions
+2 -1
View File
@@ -242,7 +242,8 @@ const startInterview = async () => {
} else if (checkAuth(res)) {
return // token 过期,已清除并跳转登录
} else {
const msg = res.data?.message || '创建面试失败'
const errMsg = typeof res.data === 'string' ? res.data : (res.data?.message || '')
const msg = errMsg || `创建面试失败(${res.statusCode}`
messages.value.push({ role: 'ai', content: msg })
}
} catch {