fix: 修复API认证问题,统一使用request工具

- 修复JWT拦截器配置,添加情绪记录和消息API到公开接口列表
- 统一前端API调用,使用services/api.ts中的request工具替代直接fetch
- 确保所有API请求都能正确携带认证token
- 修复401未授权错误问题
This commit is contained in:
2025-07-25 05:55:55 +08:00
parent 86c2df4784
commit c09cbc3f01
6 changed files with 88 additions and 394 deletions
@@ -84,11 +84,14 @@ public class JwtAuthInterceptor implements HandlerInterceptor {
// 公开接口列表
String[] publicEndpoints = {
"/api/auth/login",
"/api/auth/register",
"/api/auth/register",
"/api/auth/captcha",
"/api/auth/refresh-token",
"/api/health",
"/api/ws/chat",
"/api/emotion-records", // 情绪记录接口
"/api/emotion-summary", // 情绪总结接口
"/message", // 消息接口
"/swagger-ui",
"/v3/api-docs",
"/actuator"