diff --git a/app/components/chat/index.tsx b/app/components/chat/index.tsx index e4fb0ed..66642e9 100644 --- a/app/components/chat/index.tsx +++ b/app/components/chat/index.tsx @@ -121,8 +121,9 @@ export default function Chat() { // 跟踪新对话是否已发送第一条消息 const [newConversationFirstMessageSent, setNewConversationFirstMessageSent] = useState>(new Set()); - // 检查应用配置 - const hasSetAppConfig = CHAT_CONFIG.APP_ID && CHAT_CONFIG.API_KEY; + // 检查应用配置 - 现在客户端通过Remix API routes调用,不需要APP_KEY + // 只检查API_URL是否配置 + const hasSetAppConfig = !!CHAT_CONFIG.API_URL; /** * 处理开始聊天 diff --git a/app/config/chat.ts b/app/config/chat.ts index 6930338..ec78ff2 100644 --- a/app/config/chat.ts +++ b/app/config/chat.ts @@ -42,6 +42,12 @@ export const CHAT_CONFIG = { // 客户端 → /api/* routes → dify-client.server.ts → FastAPI /dify → Dify API_URL: getApiBaseUrl(), + // 应用ID - 用于localStorage key(固定值) + APP_ID: 'docreview-chat', + + // API_KEY 不再需要 - 服务端通过JWT处理认证 + API_KEY: '', // 保留字段以兼容旧代码 + // 应用信息 APP_INFO: { title: '大模型对话',