From 12c5ac85d3e69a831d0ae412a1ad1df661020b8a Mon Sep 17 00:00:00 2001 From: lcx Date: Thu, 17 Jul 2025 11:50:13 +0800 Subject: [PATCH 1/2] feat: Add Feishu OAuth login & consumer-grade MCP --- .../common/src/locales/keyHashMap.json | 2 ++ .../common/src/locales/scan/en-US.json | 4 ++- .../common/src/locales/scan/ja-JP.json | 4 ++- .../common/src/locales/scan/zh-CN.json | 4 ++- .../common/src/locales/scan/zh-TW.json | 4 ++- .../mcpService/IntegrationAIContainer.tsx | 29 ++++++++++++++----- .../management/ManagementInsidePage.tsx | 4 +-- 7 files changed, 38 insertions(+), 13 deletions(-) diff --git a/frontend/packages/common/src/locales/keyHashMap.json b/frontend/packages/common/src/locales/keyHashMap.json index 3de3283a..8be75ae3 100644 --- a/frontend/packages/common/src/locales/keyHashMap.json +++ b/frontend/packages/common/src/locales/keyHashMap.json @@ -576,6 +576,8 @@ "AI 代理集成": "Ke6908f16", "请先订阅该服务": "K71ed51fa", "申请": "K4aa9ed2c", + "未配置 API Key": "Kf7b54a1", + "配置": "K2a1422d2", "选择 API Key": "K1bec8cbe", "新增 API Key": "Kb0e0aeda", "API 密钥可用于调用系统级 Open API 和 MCP。": "K9d81999c", diff --git a/frontend/packages/common/src/locales/scan/en-US.json b/frontend/packages/common/src/locales/scan/en-US.json index 6c22413c..279d0c3d 100644 --- a/frontend/packages/common/src/locales/scan/en-US.json +++ b/frontend/packages/common/src/locales/scan/en-US.json @@ -984,5 +984,7 @@ "K50693bd8": "Enable Authorization", "K682b11cb": "Feishu Authorization Login", "K45c99f97": "The APP ID parameter can be found on the App Credentials and Basic Information page in the Feishu Developer Console", - "K56e77c4": "The APP Secret parameter can be found on the App Credentials and Basic Information page in the Feishu Developer Console" + "K56e77c4": "The APP Secret parameter can be found on the App Credentials and Basic Information page in the Feishu Developer Console", + "Kf7b54a1": "API Key not configured", + "K2a1422d2": "Configure" } diff --git a/frontend/packages/common/src/locales/scan/ja-JP.json b/frontend/packages/common/src/locales/scan/ja-JP.json index 62fa9ad5..f4a8e9fb 100644 --- a/frontend/packages/common/src/locales/scan/ja-JP.json +++ b/frontend/packages/common/src/locales/scan/ja-JP.json @@ -1006,5 +1006,7 @@ "K50693bd8": "認可を有効化", "K682b11cb": "Feishu 認証ログイン", "K45c99f97": "APP ID パラメータは Feishu 開発者コンソールのアプリ認証情報と基本情報ページにあります", - "K56e77c4": "APP Secret パラメータは Feishu 開発者コンソールのアプリ認証情報と基本情報ページにあります" + "K56e77c4": "APP Secret パラメータは Feishu 開発者コンソールのアプリ認証情報と基本情報ページにあります", + "Kf7b54a1": "API Key が設定されていません", + "K2a1422d2": "設定" } diff --git a/frontend/packages/common/src/locales/scan/zh-CN.json b/frontend/packages/common/src/locales/scan/zh-CN.json index 0bb1f56a..0fc2aa48 100644 --- a/frontend/packages/common/src/locales/scan/zh-CN.json +++ b/frontend/packages/common/src/locales/scan/zh-CN.json @@ -935,5 +935,7 @@ "K50693bd8": "启用授权", "K682b11cb": "飞书授权登录", "K45c99f97": "APP ID 参数位于飞书开发人员控制台中的应用程序凭证和基础信息页面上", - "K56e77c4": "APP Secret 参数位于飞书开发人员控制台中的应用程序凭证和基础信息页面上" + "K56e77c4": "APP Secret 参数位于飞书开发人员控制台中的应用程序凭证和基础信息页面上", + "Kf7b54a1": "未配置 API Key", + "K2a1422d2": "配置" } diff --git a/frontend/packages/common/src/locales/scan/zh-TW.json b/frontend/packages/common/src/locales/scan/zh-TW.json index 63f247ad..9dc123f4 100644 --- a/frontend/packages/common/src/locales/scan/zh-TW.json +++ b/frontend/packages/common/src/locales/scan/zh-TW.json @@ -1006,5 +1006,7 @@ "K50693bd8": "啟用授權", "K682b11cb": "飛書授權登入", "K45c99f97": "APP ID 參數位於飛書開發人員控制台中的應用程式憑證與基礎資訊頁面", - "K56e77c4": "APP Secret 參數位於飛書開發人員控制台中的應用程式憑證與基礎資訊頁面" + "K56e77c4": "APP Secret 參數位於飛書開發人員控制台中的應用程式憑證與基礎資訊頁面", + "Kf7b54a1": "未配置 API Key", + "K2a1422d2": "配置" } diff --git a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx index 48486726..bba68be0 100644 --- a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx +++ b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx @@ -226,6 +226,10 @@ export const IntegrationAIContainer = forwardRef { + navigator(`/consumer/${consumerParams?.teamId}/inside/${consumerParams?.consumerId}/authorization`) + } + /** * 获取全局 API Key 列表 */ @@ -492,7 +496,7 @@ export const IntegrationAIContainer = forwardRef )} - {type === 'service' && !apiKeyList.length ? ( + {(type === 'service' || type === 'consumer') && !apiKeyList.length ? ( <> -
- {$t('请先订阅该服务')} - -
+ { + type === 'service' ? ( +
+ {$t('请先订阅该服务')} + +
+ ) : ( +
+ {$t('未配置 API Key')} + +
+ ) + }
) : ( diff --git a/frontend/packages/market/src/pages/serviceHub/management/ManagementInsidePage.tsx b/frontend/packages/market/src/pages/serviceHub/management/ManagementInsidePage.tsx index 708e63dd..19130e9a 100644 --- a/frontend/packages/market/src/pages/serviceHub/management/ManagementInsidePage.tsx +++ b/frontend/packages/market/src/pages/serviceHub/management/ManagementInsidePage.tsx @@ -31,9 +31,9 @@ export default function ManagementInsidePage() { const TENANT_MANAGEMENT_APP_MENU: MenuProps['items'] = useMemo( () => [ - getItem($t('订阅的服务'), 'service', undefined, undefined, undefined, 'team.application.subscription.view'), - getItem($t('MCP 服务'), 'mcp', undefined, undefined, undefined, 'team.consumer.mcp.view'), getItem($t('访问授权'), 'authorization', undefined, undefined, undefined, 'team.consumer.authorization.view'), + getItem($t('MCP 服务'), 'mcp', undefined, undefined, undefined, 'team.consumer.mcp.view'), + getItem($t('订阅的服务'), 'service', undefined, undefined, undefined, 'team.application.subscription.view'), getItem($t('消费者管理'), 'setting', undefined, undefined, undefined, 'team.application.application.view') ], [state.language] From 16e5a37087e93733a91be9de999d991fca85daba Mon Sep 17 00:00:00 2001 From: lcx Date: Thu, 17 Jul 2025 11:51:36 +0800 Subject: [PATCH 2/2] feat: Add Feishu OAuth login & consumer-grade MCP --- frontend/packages/core/src/pages/auth/Auth.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/packages/core/src/pages/auth/Auth.tsx b/frontend/packages/core/src/pages/auth/Auth.tsx index cd337ea4..431bf57e 100644 --- a/frontend/packages/core/src/pages/auth/Auth.tsx +++ b/frontend/packages/core/src/pages/auth/Auth.tsx @@ -34,7 +34,7 @@ const Auth = () => { }, [state.language]) const onFinish = () => { form.validateFields().then((value) => { - return fetchData>(`/account/third/${value.authType}`, { + return fetchData>(`account/third/${value.authType}`, { method: 'POST', eoBody: { enable: value.enabled, @@ -71,7 +71,7 @@ const Auth = () => { value: string }[] }> - >('/account/third', { + >('account/third', { method: 'GET', }).then((response) => { const { code, data, msg } = response @@ -87,7 +87,7 @@ const Auth = () => { * 获取第三方授权配置 */ const getThirdPartyAuthSetting = () => { - fetchData>(`/account/third/${form.getFieldValue('authType')}`, { + fetchData>(`account/third/${form.getFieldValue('authType')}`, { method: 'GET', eoTransformKeys: ['client_id', 'client_secret'] }).then((response) => {