Merge remote-tracking branch 'github-pro/main' into feature/data-mask

This commit is contained in:
Liujian
2024-11-28 17:35:53 +08:00
28 changed files with 145 additions and 37 deletions
@@ -47,7 +47,6 @@ export const PolicyPublishModalContent = forwardRef<PolicyPublishModalHandle,Pol
title: typeof x.title === 'string' ? $t(x.title) : x.title,
})),[state.language])
console.log(translatedPolicyColumns,data.strategies)
return (
<>
@@ -6,7 +6,7 @@ import {BasicResponse, FORM_ERROR_TIPS, PLACEHOLDER, RESPONSE_TIPS, STATUS_CODE,
import WithPermission from "@common/components/aoplatform/WithPermission.tsx";
import { SYSTEM_PUBLISH_ONLINE_COLUMNS } from "@core/const/system/const.tsx";
import { $t } from "@common/locales";
import { ApprovalRouteColumns, ApprovalStatusColorClass, ApprovalUpstreamColumns, ChangeTypeEnum } from "@common/const/approval/const";
import { ApprovalPolicyColumns, ApprovalRouteColumns, ApprovalStatusColorClass, ApprovalUpstreamColumns, ChangeTypeEnum } from "@common/const/approval/const";
import { useGlobalContext } from "@common/contexts/GlobalStateContext";
import { LoadingOutlined } from "@ant-design/icons";
import { SystemInsidePublishOnlineItems } from "@core/pages/system/publish/SystemInsidePublishOnline";
@@ -140,6 +140,19 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
}
}),[state.language])
const translatedPolicyColumns = useMemo(()=>ApprovalPolicyColumns.map((x)=>{
return {
...x,
title: typeof x.title === 'string' ? $t(x.title) : x.title,
...(x.dataIndex === 'status' ? {
render:(_,entity)=>(
entity.status === 0 ? $t('正常') : $t('无效'))
}:{})
}
}),[state.language])
return (
<>
{!insidePage && <>
@@ -219,6 +232,16 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
/></Row>
</>
}
<Row className="mt-mbase pb-[8px] h-[32px] font-bold" ><span >{$t('策略列表')}</span></Row>
<Row className="mb-mbase ">
<Table
bordered={true}
columns={translatedPolicyColumns}
size="small"
rowKey="id"
dataSource={data.diffs?.strategies || []}
pagination={false}
/></Row>
{/* <Form.Item
label={$t("备注")}
name="remark"
@@ -179,6 +179,8 @@ export const TranslateWord = ()=>{
{$t('随机字符串')}
{$t('自定义字符串')}
{$t('请输入IP地址或CIDR范围,每条以换行分割')}
{$t('待更新')}
{$t('待删除')}
</>
)
}
@@ -241,6 +241,26 @@ export const ApprovalRouteColumns = [
}
]
export const ApprovalPolicyColumns = [
{
title:('名称'),
dataIndex:'name',
ellipsis:true,
},
{
title:('优先级'),
dataIndex:'priority',
ellipsis:true
},
{
title:('状态'),
dataIndex:'status',
}
]
export const ApprovalUpstreamColumns = [
{
title:('上游类型'),
@@ -67,6 +67,7 @@ export type PublishApprovalInfoType = {
diffs:{
apis:PublishApprovalApiItem[]
upstreams:PublishApprovalUpstreamItem[]
strategies:Array<{name:string, priority:number,statues:0|1}>
}
clusterPublishStatus?:SystemInsidePublishOnlineItems[],
error:string
@@ -232,13 +232,11 @@ export const GlobalContext = createContext<{
const globalReducer = (state: GlobalState, action: GlobalAction): GlobalState => {
switch (action.type) {
case 'LOGIN':
console.log('login')
return {
...state,
isAuthenticated: true,
};
case 'LOGOUT':
console.log('login')
return {
...state,
isAuthenticated: false,
@@ -448,7 +446,40 @@ export const GlobalProvider: FC<{children:ReactNode}> = ({ children }) => {
export const useGlobalContext = () => {
const context = useContext(GlobalContext);
if (!context) {
throw new Error('useGlobalContext must be used within a GlobalProvider');
console.warn('useGlobalContext must be used within a GlobalProvider. Returning default context.');
return {
state: {
isAuthenticated: false,
userData: null,
version: '1.0.0',
updateDate: '',
powered: '',
mainPage: '',
language: 'en-US',
pluginsLoaded: false,
},
dispatch: () => {},
accessData: new Map(),
pluginAccessDictionary: {},
menuList: [],
getGlobalAccessData: async () => ({ access: [] }),
getTeamAccessData: () => {},
getPluginAccessDictionary: () => {},
getMenuList: () => {},
resetAccess: () => {},
cleanTeamAccessData: () => {},
checkPermission: () => false,
teamDataFlushed: false,
accessInit: false,
aiConfigFlushed: false,
setAiConfigFlushed: () => {},
routeConfig: [],
setRouterConfig: () => {},
addRouteConfig: () => {},
fetchData: async () => ({}),
$t: (key: string) => key,
};
}
return context;
};
@@ -45,6 +45,8 @@
"成功": "K43fcaf94",
"上线失败": "Kc71c6a9",
"失败": "K56c686f8",
"正常": "Ke039b9b5",
"无效": "K1da86266",
"申请系统": "K1ff96ff",
"所属团队": "K9bf855d6",
"申请人": "K11b994ed",
@@ -235,6 +237,8 @@
"随机字符串": "Kea0d69df",
"自定义字符串": "Ke7c84d1d",
"请输入IP地址或CIDR范围,每条以换行分割": "K49731763",
"待更新": "K3a34d49b",
"待删除": "Kd2850420",
"暂无操作权限,请联系管理员分配。": "K23fda291",
"微信小程序": "K4618cb0a",
"获取文件,需填路径": "Ka854f511",
@@ -333,6 +337,7 @@
"API 路由": "K51d1eb5d",
"API 文档": "Ka2b6d281",
"使用说明": "Kdefa9caa",
"服务策略": "K52f72551",
"发布": "K36856e71",
"订阅管理": "K6382bbfd",
"订阅审核": "K31af5b99",
@@ -384,6 +389,8 @@
"发布申请": "K56b4254f",
"API 调用地址": "Kea2f9279",
"API base URL 一般设置为API 网关的外部网络访问地址,或者是API网关绑定的域名。": "K7fc496a1",
"集成地址": "K508d8bf4",
"与外部平台集成时,获取 API 市场中文档信息的域名": "K67f4e9bb",
"常规设置": "K8ab0fc95",
"API 请求设置": "Kb66fec9d",
"服务分类": "K4de0af74",
@@ -463,7 +470,6 @@
"添加部门": "K26c698bb",
"添加子部门": "Kb9cf2a7d",
"重命名": "Kc83551f5",
"该数据删除后将无法找回,请确认是否删除?": "K5cfdd950",
"成员": "K74aef1ad",
"设置成员和对应的角色,成员只能够看到权限范围内的功能和数据。": "K3f1077c9",
"搜索部门": "Kdce62a6",
@@ -484,7 +490,6 @@
"集群": "Ke93d36ed",
"修改配置": "K877985b7",
"设置访问 API 的集群,让 API 在分布式环境中稳定运行,并且能够根据业务需求进行灵活扩展和优化。": "Kdf66a675",
"正常": "Ke039b9b5",
"异常": "K23a3bd72",
"私有网络": "Ke1b1865",
"公共网络": "K4786c57c",
@@ -560,7 +565,6 @@
"删除服务": "Kde6bae17",
"删除操作不可恢复,请谨慎操作!": "K885ea699",
"上游": "Kda8d5ea1",
"服务策略": "K52f72551",
"服务提供了高性能 API 网关,并且可以无缝接入多种大型 AI 模型,并将这些 AI 能力打包成 API 进行调用,从而大幅简化了 AI 模型的使用门槛。同时,我们的平台提供了完善的 API 管理功能,支持 API 的创建、监控、访问控制等,保障开发者可以高效、安全地开发和管理 API 服务。": "K12f58863",
"添加服务": "K2d6658ed",
"输入名称、ID、所属团队、负责人查找服务": "K7b8f623f",
@@ -744,5 +744,10 @@
"K8457ea34": "All (0)",
"K7ca9a795": "Attribute Name",
"Kc4391744": "Attribute Value",
"K678e13fc": "Configure (0)"
"K678e13fc": "Configure (0)",
"K508d8bf4": "Integration Address",
"K67f4e9bb": "The domain name for obtaining API market documentation information when integrating with external platforms",
"K1da86266": "Invalid",
"K3a34d49b": "Pending Update",
"Kd2850420": "Pending Deletion"
}
@@ -766,5 +766,11 @@
"K8457ea34": "すべて (0)",
"K7ca9a795": "属性名",
"Kc4391744": "属性値",
"K678e13fc": "設定 (0)"
"K678e13fc": "設定 (0)",
"K508d8bf4": "統合アドレス",
"K67f4e9bb": "外部プラットフォームと統合する際に、API市場のドキュメント情報を取得するためのドメイン名",
"K1da86266": "無効",
"K3a34d49b": "更新待ち",
"Kd2850420": "削除待ち"
}
@@ -2,6 +2,7 @@
"K630c9e6d": "APIPark",
"Ka3e9f580": "发布名称",
"Kb2480682": "策略列表",
"K1da86266": "无效",
"K76036e25": "HTTP 请求头",
"K44607e3f": "全等匹配",
"Kc287500a": "前缀匹配",
@@ -40,8 +41,12 @@
"Kea0d69df": "随机字符串",
"Ke7c84d1d": "自定义字符串",
"K49731763": "请输入IP地址或CIDR范围,每条以换行分割",
"K3a34d49b": "待更新",
"Kd2850420": "待删除",
"K83237c89": "输入的IP或CIDR不符合格式",
"K5ae2c87a": "请正确输入路径,如/usr/*或*/usr/*",
"K508d8bf4": "集成地址",
"K67f4e9bb": "与外部平台集成时,获取 API 市场中文档信息的域名",
"Kc82b8374": "编辑策略",
"K4b34a5e5": "策略类型",
"K57f0fee8": "匹配条件",
@@ -10,6 +10,7 @@
"K1deaa2dd": "User",
"K631d646f": "Open API",
"K1196b104": "APIPark",
"K5cfdd950": "This data cannot be recovered after deletion. Are you sure you want to delete?",
"Kb9052305": "Search Username, Email",
"K40a89bd8": "Enter Name, ID to Search Member"
}
@@ -16,6 +16,7 @@
"K9bdd8403": "API を安全に呼び出すためには、アプリケーションとトークンを作成する必要があります。",
"Kc8239422": "チームにはユーザー、アプリケーション、サービスが含まれ、異なるチームのアプリケーションとサービスのデータは分離されています。企業内の部門/プロジェクトグループ/チームの管理に使用できます。",
"Ka0a8840a": "他のアプリケーションのサブスクリプション申請をレビューし、承認後に API リクエストが発行できます。",
"K5cfdd950": "このデータを削除すると、復元できません。削除しますか?",
"Kb9052305": "ユーザー名またはメールを検索",
"K5ece3bac": "チームとメンバーを設定してから、チーム内でサービスとアプリケーションを作成し、API をサブスクライブできます。メンバーは所属チーム内のサービスとアプリケーションのみを表示できます。",
"K1512e983": "アプリケーション呼び出し統計",
@@ -16,6 +16,7 @@
"K9bdd8403": "为了安全地调用 API,你需要创建一个消费者以及Token。",
"Kc8239422": "团队中包含了人员、消费者和服务,不同团队之间的消费者和服务数据是隔离的,可用于管理企业内部不同的部门/项目组/团队。",
"Ka0a8840a": "审核其他消费者的订阅申请,审核通过后的才可发起 API 请求。",
"K5cfdd950": "该数据删除后将无法找回,是否删除?",
"Kb9052305": "搜索用户名、邮箱",
"K5ece3bac": "设置团队和成员,然后你可以在团队内创建服务和消费者、订阅API,成员只能看到所属团队内的服务和消费者。",
"K1512e983": "消费者调用统计",
@@ -16,6 +16,7 @@
"K9bdd8403": "為了安全地調用 API,你需要創建一個應用以及Token。",
"Kc8239422": "團隊中包含了人員、應用程式和服務,不同團隊之間的應用程式和服務數據是隔離的,可用於管理企業內部不同的部門/項目組/團隊。",
"Ka0a8840a": "審核其他應用程式的訂閱申請,審核通過後的才可發起 API 請求。",
"K5cfdd950": "該數據刪除後將無法找回,是否刪除?",
"Kb9052305": "搜索用戶名、電郵",
"K5ece3bac": "設置團隊和成員,然後你可以在團隊內創建服務和應用程式、訂閱API,成員只能看到所屬團隊內的服務和應用程式。",
"K1512e983": "應用程式調用統計",
@@ -766,5 +766,10 @@
"K8457ea34": "所有(0)",
"K7ca9a795": "屬性名稱",
"Kc4391744": "屬性值",
"K678e13fc": "配置(0)"
"K678e13fc": "配置(0)",
"K508d8bf4": "集成地址",
"K67f4e9bb": "與外部平台集成時,用於獲取 API 市場文檔信息的域名",
"K1da86266": "無效",
"K3a34d49b": "待更新",
"Kd2850420": "待刪除"
}
+3 -3
View File
@@ -152,8 +152,8 @@ function App() {
wave={{disabled:true}}
theme={antdComponentThemeToken}
form={{validateMessages }}>
<AppAntd className="h-full" message={{ maxCount: 1 }}>
<PluginEventHubProvider>
<PluginEventHubProvider>
<AppAntd className="h-full" message={{ maxCount: 1 }}>
<PluginSlotHubProvider>
<GlobalProvider>
<BreadcrumbProvider>
@@ -161,8 +161,8 @@ function App() {
</BreadcrumbProvider>
</GlobalProvider>
</PluginSlotHubProvider>
</PluginEventHubProvider>
</AppAntd>
</PluginEventHubProvider>
</ConfigProvider>
</StyleProvider>
);
@@ -67,7 +67,6 @@ const Login:FC = ()=> {
if (code === STATUS_CODE.SUCCESS) {
dispatch({type:'LOGIN'})
console.log('1')
// message.success($t(RESPONSE_TIPS.loginSuccess));
const callbackUrl = new URLSearchParams(window.location.search).get('callbackUrl');
if (callbackUrl && callbackUrl !== 'null') {
@@ -4,7 +4,6 @@ import { Navigate, useLocation } from "react-router-dom"
export default function Root() {
const { state } = useGlobalContext()
const location = useLocation()
console.log(state?.isAuthenticated ,location?.pathname)
return (<>
{
state?.isAuthenticated && !location?.pathname
@@ -63,6 +63,7 @@ const AiServiceInsidePage:FC = ()=> {
getItem(<Link to="./route">{$t('API 路由')}</Link>, 'route',undefined,undefined,undefined,'team.service.router.view'),
getItem(<Link to="./api">{$t('API 文档')}</Link>, 'api',undefined,undefined,undefined,'team.service.api_doc.view'),
getItem(<Link to="./document">{$t('使用说明')}</Link>, 'document',undefined,undefined,undefined,'team.service.service_intro.view'),
getItem(<Link to="./servicepolicy">{$t('服务策略')}</Link>, 'servicepolicy', undefined, undefined, undefined, 'team.service.policy.view'),
getItem(<Link to="./publish">{$t('发布')}</Link>, 'publish',undefined,undefined,undefined,'team.service.release.view'),
],
'group'),
@@ -111,7 +112,9 @@ const AiServiceInsidePage:FC = ()=> {
setShowMenu(!routeId && !currentUrl.includes('route/create'))
if(apiId !== undefined){
setActiveMenu('api')
}else if(serviceId !== currentUrl.split('/')[currentUrl.split('/').length - 1]){
} else if(currentUrl.includes('servicepolicy')){
setActiveMenu('servicepolicy')
} else if(serviceId !== currentUrl.split('/')[currentUrl.split('/').length - 1]){
setActiveMenu(currentUrl.split('/')[currentUrl.split('/').length - 1])
}else{
setActiveMenu('route')
@@ -10,6 +10,7 @@ type ApiRequestSettingFieldType = {
siteLogo:string
invokeAddress:string
platformName:string
sitePrefix:string
}
export default function ApiRequestSetting(){
@@ -20,7 +21,7 @@ export default function ApiRequestSetting(){
const onFinish = () => {
form.validateFields().then((value)=>{
return fetchData<BasicResponse<null>>('system/general',{method:'POST',eoBody:(value),eoTransformKeys:['invokeAddress','siteName','siteLogo','platformName']}).then(response=>{
return fetchData<BasicResponse<null>>('system/general',{method:'POST',eoBody:(value),eoTransformKeys:['invokeAddress','siteName','siteLogo','platformName','sitePrefix']}).then(response=>{
const {code,msg} = response
if(code === STATUS_CODE.SUCCESS){
message.success(msg || $t(RESPONSE_TIPS.success))
@@ -37,7 +38,7 @@ export default function ApiRequestSetting(){
};
const getSystemSetting = ()=>{
fetchData<BasicResponse<{ general: ApiRequestSettingFieldType }>>('system/general',{method:'GET',eoTransformKeys:['site_name', 'site_logo','invoke_address','platform_name']}).then(response=>{
fetchData<BasicResponse<{ general: ApiRequestSettingFieldType }>>('system/general',{method:'GET',eoTransformKeys:['site_name', 'site_logo','invoke_address','platform_name','site_prefix']}).then(response=>{
const {code,data,msg} = response
if(code === STATUS_CODE.SUCCESS){
form.setFieldsValue(data.general)
@@ -74,6 +75,14 @@ export default function ApiRequestSetting(){
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
</Form.Item>
<Form.Item<ApiRequestSettingFieldType>
label={$t("集成地址")}
name="sitePrefix"
rules={[{ required: true,whitespace:true }]}
extra={$t("与外部平台集成时,获取 API 市场中文档信息的域名")}
>
<Input className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)}/>
</Form.Item>
<Row className="mb-[10px]"
>
@@ -81,7 +81,6 @@ const RemoteFormItem: React.FC<FilterFormItemProps> = (props) =>{
type: 'checkbox',
onChange: (selectedRowKeys: React.Key[]) => {
onChange?.(selectedRowKeys as string[]);
console.log(originRemoteList)
onShowValueChange?.(selectedRowKeys.length === remoteCounts? $t('所有(0)',[title]) : originRemoteList.filter(x=>selectedRowKeys?.indexOf(x[option.key]))?.map(x=>x.title).join(' , '))
},
selectedRowKeys: value,
@@ -94,17 +93,14 @@ const RemoteFormItem: React.FC<FilterFormItemProps> = (props) =>{
onClick:()=>{
if(value === undefined){
onChange?.([record[rowKey]])
console.log(record[rowKey],record)
onShowValueChange?.(remoteCounts === 1 ? $t('所有(0)',[option?.title]) : record.name)
}else if(value?.indexOf(record[rowKey])!== -1){
const newSelectedKeys = value?.filter(x=>x!==record[rowKey])
onChange?.(newSelectedKeys!)
console.log(newSelectedKeys,newSelectedKeys.length === remoteCounts? $t('所有(0)',[option?.title]) : originRemoteList.filter(x=>newSelectedKeys.indexOf(x[rowKey]) !== -1)?.map(x=>x.name)?.join(' , '))
onShowValueChange?.(newSelectedKeys.length === remoteCounts? $t('所有(0)',[option?.title]) : originRemoteList.filter(x=>newSelectedKeys.indexOf(x[rowKey]) !== -1)?.map(x=>x.name)?.join(' , '))
}else{
const newSelectedKeys = [...value,record[rowKey]]
onChange?.(newSelectedKeys)
console.log(newSelectedKeys,originRemoteList,rowKey,remoteCounts,newSelectedKeys.length === remoteCounts? $t('所有(0)',[option?.title]) : originRemoteList.filter(x=>newSelectedKeys.indexOf(x[rowKey]) !== -1)?.map(x=>x.name)?.join(' , '))
onShowValueChange?.(newSelectedKeys.length === remoteCounts? $t('所有(0)',[option?.title]) : originRemoteList.filter(x=>newSelectedKeys.indexOf(x[rowKey]) !== -1)?.map(x=>x.name)?.join(' , '))
}
}
@@ -172,7 +168,6 @@ const FilterForm = forwardRef<FilterFormHandle,FilterFormProps>(({
},
save:()=>form.validateFields().then((res)=>{
const selectedOption = filterOptions.filter(x=>x.name === res.name)[0]
console.log('??',res,selectedOption,filterType,label)
return Promise.resolve({
...res,
label:filterType === 'pattern' ? res.values : label,
@@ -57,14 +57,12 @@ const FilterTable: React.FC<FilterTableProps> = ({
label:res.label,
title:res.title
}
console.log(res, newFilterForm, value)
onChange?.([newFilterForm, ...(value?.filter(x=>!filterForm?.name|| x.name!==filterForm.name) || [])])
closeDrawer()
})
};
const handleDeleteFilter = useCallback((item: FilterFormField) => {
console.log(item, value, isModalVisible);
const newFilterShowList = value?.filter((filter) => filter._eoKey !== item._eoKey) || [];
onChange?.(newFilterShowList);
}, [value, onChange]);
@@ -109,7 +107,6 @@ const FilterTable: React.FC<FilterTableProps> = ({
useEffect(()=>{
setSelectedOptionNameSet(new Set(value?.map(x=>x.name) || []))
console.log('valuechange',value)
},[value])
return (
<div>
@@ -33,7 +33,6 @@ const DataMasking = (props: any) => {
const drawerRef = useRef<PolicyPublishModalHandle>(null)
const { modal } = App.useApp()
useEffect(()=>{console.log(props, publishBtn)},[publishBtn])
/**
* ref
*/
@@ -104,7 +103,6 @@ const DataMasking = (props: any) => {
* @param entity
*/
const changeOpenApiStatus = (enabled: boolean, entity: any) => {
console.log(enabled)
fetchData<BasicResponse<null>>(
`strategy/${serviceId === undefined? 'global':'service'}/data-masking/${enabled ? 'enable' :'disable' }`,
{
@@ -39,7 +39,7 @@ const DataMaskingConfig = forwardRef<DataMaskingConfigHandle>((_,ref) => {
form.setFieldsValue({
...data.strategy,
type:'data-masking',
filters:data.strategy.filters.map((x)=>{x._eoKey = uuidv4(); return x})
filters:data.strategy.filters?.map((x)=>{x._eoKey = uuidv4(); return x})
})
},0)
}else{
@@ -65,7 +65,7 @@ const DataMaskingConfig = forwardRef<DataMaskingConfigHandle>((_,ref) => {
const {code,data,msg} = response
if(code === STATUS_CODE.SUCCESS){
message.success(msg || $t(RESPONSE_TIPS.success))
navigator(serviceId? '':'/globalpolicy/datamasking/list')
navigator('../list')
return Promise.resolve(true)
}else{
message.error(msg || $t(RESPONSE_TIPS.error))
@@ -14,7 +14,6 @@ const servicePolicy = () => {
}
]
console.log('publish',false)
return (
<>
<PolicyTabContainer tabs={tabItems} />
@@ -125,9 +125,10 @@ const RoleList = ()=>{
pageTitle={$t('角色')}
description={$t("设置角色的权限范围。")}
showBorder={false}
scrollPage={false}
scrollPage={true}
>
<div className="pr-PAGE_INSIDE_X">
<div className="pr-PAGE_INSIDE_X overflow-y-scroll h-full">
<div>
<h3 className="mt-0">{$t('系统级别角色')}</h3>
<PageList
id="global_role"
@@ -145,6 +146,8 @@ const RoleList = ()=>{
onRowClick={(row:RoleTableListItem)=> navigateTo(`/role/system/config/${row.id}`)}
tableClickAccess="system.organization.role.system.edit"
/>
</div>
<div>
<h3 className=" pt-btnbase ">{$t('团队级别角色')}</h3>
<PageList
id="global_role"
@@ -163,6 +166,7 @@ const RoleList = ()=>{
tableClickAccess="system.organization.role.team.edit"
/>
</div>
</div>
</InsidePage>
</>)
}
@@ -98,7 +98,7 @@ export default function MonitorDetailPage(props:MonitorDetailPageProps){
setTimeButton('hour');
setDatePickerValue(null)
setQueryData(null);
monitorTableRef.current?.reload()
// monitorTableRef.current?.reload()
};
const openModal = (entity:MonitorApiData|MonitorSubscriberData) => {
@@ -14,7 +14,7 @@ const Integrate = ({ service }: { service: ServiceDetailType }) => {
const {fetchData} = useFetch()
useEffect(()=>{
setUrl(`${service?.basic?.sitePrefix || window.location?.origin}/${serviceId}/swagger` )
setUrl(`${service?.basic?.sitePrefix || window.location?.origin}/api/v1/service/swagger/${serviceId}` )
},[service])
/**
* Agent
@@ -60,7 +60,7 @@ const Integrate = ({ service }: { service: ServiceDetailType }) => {
<Button type="primary" onClick={copyURL}>{$t('复制 URL')}</Button>
</Space.Compact>
<span className="text-[14px] font-bold">OR</span>
<Button onClick={onDownload}>{$t('下载 Json 文件')}</Button>
<Button href={`/api/v1/export/openapi/${serviceId}`} target="_blank">{$t('下载 Json 文件')}</Button>
</div>
<p className={stepClass}>{$t('步骤三:配置 API 密钥')}</p>
<div className='my-[10px]'>{$t('在')}<a href={consumerAddress} target="_blank"> {$t('消费者')} </a>{$t('菜单中,选择已通过本 API 服务申请的消费者,')}</div>