fix: sync MarketApp MCP records to admin MCP Client management

This commit is contained in:
QihuAI Design committed 2026-07-16 18:12:07 +08:00
1 parent c9b5f964be
commit feb9865b00
3 files changed
+1333 -1223

No files matched your search

+8 -3
View File
@@ -1491,8 +1491,9 @@ const MarketPage: React.FC = () => {
// Handle hub import - 调用后端 API 创建应用
const handleHubImport = async (platformName: string, url: string, skillName: string, price?: number, description?: string) => {
try {
const desc = description || `从 ${platformName} 导入的${showHubImport === 'skill' ? 'Skills工具' : 'MCP应用'} (来源: ${url})`;
await marketAPI.createApp({
const isMcp = showHubImport === 'mcp';
const desc = description || `从 ${platformName} 导入的${isMcp ? 'MCP应用' : 'Skills工具'}${!isMcp ? ` (来源: ${url})` : ''}`;
const payload: any = {
name: skillName,
type: showHubImport || 'skill',
description: desc,
@@ -1500,7 +1501,11 @@ const MarketPage: React.FC = () => {
is_member_free: (price || 0) === 0,
join_promotion: false,
source: 'user',
});
};
if (isMcp && url) {
payload.download_url = url;
}
await marketAPI.createApp(payload);
// 重新加载列表
loadApps();
} catch (e: any) {