新增: AI 助手 Markdown 渲染+打字机流式+桌面 Rust 代理修复 CORS
This commit is contained in:
@@ -205,8 +205,11 @@ pub async fn ai_proxy_stream(
|
||||
.map_err(|e| format!("请求失败: {}", e))?;
|
||||
|
||||
if !resp.status().is_success() {
|
||||
let status = resp.status().as_u16();
|
||||
let text = resp.text().await.unwrap_or_default();
|
||||
return Ok(text);
|
||||
// 错误体带状态码前缀,前端按「接口返回 N」格式提示
|
||||
let _ = app.emit("ai-error", &text);
|
||||
return Err(format!("__HTTP_{}__{}", status, text));
|
||||
}
|
||||
|
||||
// 流式读取 SSE
|
||||
|
||||
Reference in New Issue
Block a user