diff --git a/Cunkebao/src/pages/mobile/workspace/ai-knowledge/detail/index.tsx b/Cunkebao/src/pages/mobile/workspace/ai-knowledge/detail/index.tsx
index 4d2705ed5..398a1caa1 100644
--- a/Cunkebao/src/pages/mobile/workspace/ai-knowledge/detail/index.tsx
+++ b/Cunkebao/src/pages/mobile/workspace/ai-knowledge/detail/index.tsx
@@ -39,6 +39,7 @@ import {
} from "./api";
import { deleteKnowledgeBase } from "../list/api";
import type { KnowledgeBase, Material, Caller } from "./data";
+import FileUpload from "@/components/Upload/FileUpload";
type TabType = "info" | "materials";
@@ -496,24 +497,32 @@ const AIKnowledgeDetail: React.FC = () => {
{/* 系统预设不显示上传按钮 */}
{!isSystemPreset && (
-
{
- handleUpload(file);
- return false;
- }}
- >
- }
- className={style.uploadButton}
- size="large"
- >
- 上传素材到此库
-
-
+
+ {
+ // v 可能为 string 或 string[]:单传取 string
+ const uploadUrl = Array.isArray(v) ? v[0] : v;
+ if (uploadUrl && id) {
+ try {
+ await uploadMaterial({
+ typeId: Number(id),
+ name: uploadUrl.split("/").pop() || "已上传文件",
+ label: [],
+ fileUrl: uploadUrl,
+ });
+ message.success("上传成功");
+ fetchDetail();
+ } catch (e) {
+ message.error("上传失败");
+ }
+ }
+ }}
+ />
+
)}
-
{materials.length > 0 ? (
materials.map(material => (
@@ -600,7 +609,7 @@ const AIKnowledgeDetail: React.FC = () => {
className={`${style.tab} ${activeTab === "materials" ? style.tabActive : ""}`}
onClick={() => setActiveTab("materials")}
>
- {knowledgeBase?.name || "知识库"}
+ 客户案例
@@ -614,8 +623,8 @@ const AIKnowledgeDetail: React.FC = () => {
) : (
<>
- {activeTab === "info" && renderInfoTab()}
- {activeTab === "materials" && renderMaterialsTab()}
+ {activeTab === "info" && renderMaterialsTab()}
+ {activeTab === "materials" && renderInfoTab()}
>
)}