Add login gate, calculation history, and AI markdown download.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-13 09:39:38 +08:00
parent abf78cbbb5
commit 462bec2739
23 changed files with 878 additions and 74 deletions
+3 -1
View File
@@ -20,7 +20,7 @@ function parseApiError(text: string, status: number): string {
export async function streamAiCompletion(
body: AiRequestBody,
onUpdate: (text: string) => void,
): Promise<void> {
): Promise<string> {
const res = await fetch("/api/ai", {
method: "POST",
cache: "no-store",
@@ -55,4 +55,6 @@ export async function streamAiCompletion(
if (!text.trim()) {
throw new Error("AI 返回内容为空,请检查模型配置或稍后重试");
}
return decodeHexByteEscapes(text);
}