更新依赖,优化认证流程;添加聊天框动画效果,优化消息处理逻辑

This commit is contained in:
2026-03-24 10:56:25 +08:00
parent accf6ad254
commit 045391d036
9 changed files with 879 additions and 326 deletions
+11 -2
View File
@@ -49,14 +49,23 @@ export const streamCopilotChat = async ({
message,
conversation_id: conversationId,
}),
skipAuthRedirect: true,
});
if (!response.ok || !response.body) {
const detail = await response.text();
let message = "stream request failed";
if (response.status === 403) {
message = "Permission denied. Please contact administrator.";
} else if (response.status === 401) {
message = "Login expired. Please sign in again.";
}
onEvent({
type: "error",
message: "stream request failed",
detail,
message,
detail: (response.status === 403 || response.status === 401) ? undefined : detail,
});
return;
}