feat:替换 Dify 为自建 RAG去实现

1、修复了若干无权限时的失败提示语
2、新增了一个生成后续建议问题的功能
3、重构了知识问答部分的权限管理模块
4、修复了若干渲染不恰当的样式渲染
This commit is contained in:
PingChuan
2026-04-10 16:20:32 +08:00
parent f525707358
commit 5bee9288b9
31 changed files with 407 additions and 304 deletions
+6 -2
View File
@@ -39,8 +39,12 @@ export async function loader({ request }: LoaderFunctionArgs) {
} catch (error: any) {
console.error('❌ [API] Conversations API - Error:', error);
// 检查是否是JWT认证失败
const status = error.message?.includes('JWT认证失败') ? 401 : 500;
// 从错误中提取原始 HTTP 状态码
const statusMatch = error.message?.match(/(\d{3})/);
const originalStatus = statusMatch ? parseInt(statusMatch[1]) : 0;
const status = error.message?.includes('JWT认证失败') ? 401
: originalStatus >= 400 && originalStatus < 500 ? originalStatus
: 500;
return json(
{