diff --git a/packages/global/common/system/types/index.d.ts b/packages/global/common/system/types/index.d.ts index 5a0471f7b..23b53e2c8 100644 --- a/packages/global/common/system/types/index.d.ts +++ b/packages/global/common/system/types/index.d.ts @@ -64,6 +64,12 @@ export type FastGPTFeConfigsType = { show_coupon?: boolean; concatMd?: string; + show_dataset_feishu?: boolean; + show_dataset_yuque?: boolean; + show_publish_feishu?: boolean; + show_publish_dingtalk?: boolean; + show_publish_offiaccount?: boolean; + concatMd?: string; docUrl?: string; openAPIDocUrl?: string; diff --git a/projects/app/src/pageComponents/app/detail/Publish/index.tsx b/projects/app/src/pageComponents/app/detail/Publish/index.tsx index a13b32ef3..43980ef42 100644 --- a/projects/app/src/pageComponents/app/detail/Publish/index.tsx +++ b/projects/app/src/pageComponents/app/detail/Publish/index.tsx @@ -42,20 +42,28 @@ const OutLink = () => { value: PublishChannelEnum.apikey, isProFn: false }, - { - icon: 'core/app/publish/lark', - title: t('publish:feishu_bot'), - desc: t('publish:feishu_bot_desc'), - value: PublishChannelEnum.feishu, - isProFn: true - }, - { - icon: 'common/dingtalkFill', - title: t('publish:dingtalk.bot'), - desc: t('publish:dingtalk.bot_desc'), - value: PublishChannelEnum.dingtalk, - isProFn: true - }, + ...(feConfigs?.show_publish_feishu !== false + ? [ + { + icon: 'core/app/publish/lark', + title: t('publish:feishu_bot'), + desc: t('publish:feishu_bot_desc'), + value: PublishChannelEnum.feishu, + isProFn: true + } + ] + : []), + ...(feConfigs?.show_publish_dingtalk !== false + ? [ + { + icon: 'common/dingtalkFill', + title: t('publish:dingtalk.bot'), + desc: t('publish:dingtalk.bot_desc'), + value: PublishChannelEnum.dingtalk, + isProFn: true + } + ] + : []), // { // icon: 'core/app/publish/wecom', // title: t('publish:wecom.bot'), @@ -63,13 +71,17 @@ const OutLink = () => { // value: PublishChannelEnum.wecom, // isProFn: true // }, - { - icon: 'core/app/publish/offiaccount', - title: t('publish:official_account.name'), - desc: t('publish:official_account.desc'), - value: PublishChannelEnum.officialAccount, - isProFn: true - } + ...(feConfigs?.show_publish_offiaccount !== false + ? [ + { + icon: 'core/app/publish/offiaccount', + title: t('publish:official_account.name'), + desc: t('publish:official_account.desc'), + value: PublishChannelEnum.officialAccount, + isProFn: true + } + ] + : []) ]); const [linkType, setLinkType] = useState(PublishChannelEnum.share); diff --git a/projects/app/src/pages/dataset/list/index.tsx b/projects/app/src/pages/dataset/list/index.tsx index b31c25be1..51e702a87 100644 --- a/projects/app/src/pages/dataset/list/index.tsx +++ b/projects/app/src/pages/dataset/list/index.tsx @@ -177,18 +177,26 @@ const Dataset = () => { description: t('dataset:external_file_dataset_desc'), onClick: () => onSelectDatasetType(DatasetTypeEnum.apiDataset) }, - { - icon: 'core/dataset/feishuDatasetColor', - label: t('dataset:feishu_dataset'), - description: t('dataset:feishu_dataset_desc'), - onClick: () => onSelectDatasetType(DatasetTypeEnum.feishu) - }, - { - icon: 'core/dataset/yuqueDatasetColor', - label: t('dataset:yuque_dataset'), - description: t('dataset:yuque_dataset_desc'), - onClick: () => onSelectDatasetType(DatasetTypeEnum.yuque) - } + ...(feConfigs?.show_dataset_feishu !== false + ? [ + { + icon: 'core/dataset/feishuDatasetColor', + label: t('dataset:feishu_dataset'), + description: t('dataset:feishu_dataset_desc'), + onClick: () => onSelectDatasetType(DatasetTypeEnum.feishu) + } + ] + : []), + ...(feConfigs?.show_dataset_yuque !== false + ? [ + { + icon: 'core/dataset/yuqueDatasetColor', + label: t('dataset:yuque_dataset'), + description: t('dataset:yuque_dataset_desc'), + onClick: () => onSelectDatasetType(DatasetTypeEnum.yuque) + } + ] + : []) ] }, {