diff --git a/docSite/content/zh-cn/docs/development/upgrading/492.md b/docSite/content/zh-cn/docs/development/upgrading/492.md index e8e6652f7..ec006a73b 100644 --- a/docSite/content/zh-cn/docs/development/upgrading/492.md +++ b/docSite/content/zh-cn/docs/development/upgrading/492.md @@ -19,6 +19,7 @@ weight: 799 1. 导出对话日志时,支持导出成员名。 2. 邀请链接交互。 3. 无 SSL 证书时复制失败,会提示弹窗用于手动复制。 +4. FastGPT 未内置 ai proxy 渠道时,也能正常展示其名称。 ## 🐛 修复 diff --git a/projects/app/src/pageComponents/account/model/Channel/index.tsx b/projects/app/src/pageComponents/account/model/Channel/index.tsx index accd1ba32..c4e95ca5c 100644 --- a/projects/app/src/pageComponents/account/model/Channel/index.tsx +++ b/projects/app/src/pageComponents/account/model/Channel/index.tsx @@ -1,4 +1,10 @@ -import { deleteChannel, getChannelList, putChannel, putChannelStatus } from '@/web/core/ai/channel'; +import { + deleteChannel, + getChannelList, + getChannelProviders, + putChannel, + putChannelStatus +} from '@/web/core/ai/channel'; import { useRequest2 } from '@fastgpt/web/hooks/useRequest'; import React, { useState } from 'react'; import { @@ -50,6 +56,10 @@ const ChannelTable = ({ Tab }: { Tab: React.ReactNode }) => { manual: false }); + const { data: channelProviders = {} } = useRequest2(getChannelProviders, { + manual: false + }); + const [editChannel, setEditChannel] = useState(); const { runAsync: updateChannel, loading: loadingUpdateChannel } = useRequest2(putChannel, { @@ -111,7 +121,10 @@ const ChannelTable = ({ Tab }: { Tab: React.ReactNode }) => { {channelList.map((item) => { - const providerData = aiproxyIdMap[item.type]; + const providerData = aiproxyIdMap[item.type] || { + label: channelProviders[item.type]?.name || 'Invalid provider', + provider: 'Other' + }; const provider = getModelProvider(providerData?.provider); return ( @@ -119,14 +132,10 @@ const ChannelTable = ({ Tab }: { Tab: React.ReactNode }) => { {item.id} {item.name} - {providerData ? ( - - - {t(providerData?.label as any)} - - ) : ( - 'Invalid provider' - )} + + + {t(providerData?.label as any)} +