fix(ai): 修复AI代理请求和图片生成功能
- 添加详细的错误日志记录,包括请求读取、渠道选择、请求构建和响应处理的失败情况 - 统一AI接口请求失败返回消息为"AI 接口请求失败" - 添加对上游响应状态码>=400的检查和错误处理 - 在JWT解析中验证签名方法有效性,防止无效登录状态 - 移除JWT密钥警告日志,改为运行时生成随机密钥 - 调整应用配置模态框中云端和本地选项的显示顺序 - 添加图片生成元数据记录生成类型、模型、尺寸、质量和参考图等信息 - 实现空图片节点直接生成图片而不保留空框的功能 - 完善图片重试逻辑,优先使用保存的元数据进行重试 - 添加参考图片丢失时的错误提示 - 修复图片节点样式圆角显示问题 - 更新AI代理路径为/api/v1/*保持OpenAI风格 - 添加系统设置页面的安全警告提示
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { CheckCircleOutlined, DeleteOutlined, FormatPainterOutlined, PlusOutlined, ReloadOutlined, SaveOutlined } from "@ant-design/icons";
|
||||
import { json } from "@codemirror/lang-json";
|
||||
import { App, Button, Card, Col, Drawer, Flex, Form, Input, InputNumber, Modal, Row, Segmented, Select, Space, Switch, Table, Tabs, Tag, Typography } from "antd";
|
||||
import { Alert, App, Button, Card, Col, Drawer, Flex, Form, Input, InputNumber, Modal, Row, Segmented, Select, Space, Switch, Table, Tabs, Tag, Typography } from "antd";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { EditorView } from "@uiw/react-codemirror";
|
||||
@@ -294,6 +294,11 @@ export default function AdminSettingsPage() {
|
||||
) : activeMode === "visual" ? (
|
||||
<Form form={form} layout="vertical" initialValues={emptySettings} requiredMark={false}>
|
||||
<Flex vertical gap={12}>
|
||||
<Alert
|
||||
showIcon
|
||||
type="warning"
|
||||
message="当前还没有完整用户体系,所有访问到站点的用户都可以无条件使用后端渠道 API。请不要公网部署,避免私有渠道额度被他人消耗。"
|
||||
/>
|
||||
<Button type="primary" icon={<PlusOutlined />} onClick={() => openChannelDrawer(null)}>新增渠道</Button>
|
||||
<Table
|
||||
rowKey={(_, index) => String(index)}
|
||||
|
||||
Reference in New Issue
Block a user