feat:替换 Dify 为自建 RAG去实现
1、修复了若干无权限时的失败提示语 2、新增了一个生成后续建议问题的功能 3、重构了知识问答部分的权限管理模块 4、修复了若干渲染不恰当的样式渲染
This commit is contained in:
@@ -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(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user