|
@@ -2,7 +2,7 @@ import HttpClient from '@/components/HttpUtil';
|
|
|
import {
|
|
|
loanApiIntegration,
|
|
|
queryApiLoan,
|
|
|
- queryEgressApiEndpoint,
|
|
|
+ queryEgressApiChannel,
|
|
|
} from '@/services/op-admin/gateway/egress';
|
|
|
import { queryMerchant } from '@/services/op-admin/gateway/merchant';
|
|
|
import {
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
StepsForm,
|
|
|
} from '@ant-design/pro-components';
|
|
|
import { useLocation } from '@umijs/max';
|
|
|
+import { history } from 'umi';
|
|
|
import { Button, message, Popconfirm, Spin } from 'antd';
|
|
|
import React, { useRef, useState } from 'react';
|
|
|
-import { history } from 'umi';
|
|
|
|
|
|
/**
|
|
|
* @author bianlanzhou
|
|
@@ -35,24 +35,24 @@ const LoanIntegration: React.FC = () => {
|
|
|
/** 页面loading */
|
|
|
const [pageLoading, setPageLoading] = useState<boolean>(false);
|
|
|
/** 撞库通道集成方式 */
|
|
|
- const [ciEndpointIntegrationMode, setCiEndpointIntegrationMode] = useState('customize');
|
|
|
+ const [ciChannelIntegrationMode, setCiChannelIntegrationMode] = useState('customize');
|
|
|
/** 注册通道集成方式 */
|
|
|
- const [apyEndpointIntegrationMode, setApyEndpointIntegrationMode] = useState('customize');
|
|
|
+ const [apyChannelIntegrationMode, setApyChannelIntegrationMode] = useState('customize');
|
|
|
/** 撞库通道ID */
|
|
|
- const [checkintoEndpointId, setCheckintoEndpointId] = useState<string>('');
|
|
|
+ const [checkintoChannelId, setCheckintoChannelId] = useState<string>('');
|
|
|
/** 申请注册ID */
|
|
|
- const [applyEndpointId, setApplyintoEndpointId] = useState<string>('');
|
|
|
+ const [applyChannelId, setApplyintoChannelId] = useState<string>('');
|
|
|
/** 查询撞库通道 */
|
|
|
- const handleQueryCheckintoEndpoint = () => {
|
|
|
- return queryEgressApiEndpoint({
|
|
|
- endpointCode: 'checkinto',
|
|
|
+ const handleQueryCheckintoChannel = () => {
|
|
|
+ return queryEgressApiChannel({
|
|
|
+ channelCode: 'checkinto',
|
|
|
apiId: (location.state as { id: string; from: string }).id,
|
|
|
})
|
|
|
.then((resp) => {
|
|
|
if (resp.data && resp.data.length > 0) {
|
|
|
let integrationMode = resp.data[0].integrationMode;
|
|
|
- setCiEndpointIntegrationMode(integrationMode);
|
|
|
- setCheckintoEndpointId(resp.data[0].id);
|
|
|
+ setCiChannelIntegrationMode(integrationMode);
|
|
|
+ setCheckintoChannelId(resp.data[0].id);
|
|
|
if (integrationMode === 'guide') {
|
|
|
return {
|
|
|
...resp.data[0],
|
|
@@ -66,7 +66,7 @@ const LoanIntegration: React.FC = () => {
|
|
|
}
|
|
|
} else {
|
|
|
//默认值
|
|
|
- setCiEndpointIntegrationMode('customize');
|
|
|
+ setCiChannelIntegrationMode('customize');
|
|
|
return {
|
|
|
integrationMode: 'customize',
|
|
|
};
|
|
@@ -76,16 +76,16 @@ const LoanIntegration: React.FC = () => {
|
|
|
};
|
|
|
|
|
|
/** 查询申请通道 */
|
|
|
- const handleQueryApplyEndpoint = () => {
|
|
|
- return queryEgressApiEndpoint({
|
|
|
- endpointCode: 'apply',
|
|
|
+ const handleQueryApplyChannel = () => {
|
|
|
+ return queryEgressApiChannel({
|
|
|
+ channelCode: 'apply',
|
|
|
apiId: (location.state as { id: string; from: string }).id,
|
|
|
})
|
|
|
.then((resp) => {
|
|
|
if (resp.data && resp.data.length > 0) {
|
|
|
let integrationMode = resp.data[0].integrationMode;
|
|
|
- setApyEndpointIntegrationMode(resp.data[0].integrationMode);
|
|
|
- setApplyintoEndpointId(resp.data[0].id);
|
|
|
+ setApyChannelIntegrationMode(resp.data[0].integrationMode);
|
|
|
+ setApplyintoChannelId(resp.data[0].id);
|
|
|
if (integrationMode === 'guide') {
|
|
|
return {
|
|
|
...resp.data[0],
|
|
@@ -98,7 +98,7 @@ const LoanIntegration: React.FC = () => {
|
|
|
};
|
|
|
}
|
|
|
} else {
|
|
|
- setApyEndpointIntegrationMode('customize');
|
|
|
+ setApyChannelIntegrationMode('customize');
|
|
|
return {
|
|
|
integrationMode: 'customize',
|
|
|
};
|
|
@@ -133,8 +133,8 @@ const LoanIntegration: React.FC = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- /** 处理通道formData */
|
|
|
- const handleEndpointFormData = (endpointId: string, formData: any) => {
|
|
|
+ /** 处理撞库通道formData */
|
|
|
+ const handleChannelFormData = (channelId: string, formData: any) => {
|
|
|
const locationStateData = location.state as { id: string; from: string };
|
|
|
let requestConfigStr = '';
|
|
|
if (formData.integrationMode === 'guide') {
|
|
@@ -151,7 +151,7 @@ const LoanIntegration: React.FC = () => {
|
|
|
requestConfigStr = formData.requestConfig;
|
|
|
}
|
|
|
return {
|
|
|
- id: endpointId,
|
|
|
+ id: channelId,
|
|
|
apiId: locationStateData.id,
|
|
|
integrationMode: formData.integrationMode,
|
|
|
requestConfig: requestConfigStr,
|
|
@@ -159,6 +159,7 @@ const LoanIntegration: React.FC = () => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+
|
|
|
return (
|
|
|
<PageContainer
|
|
|
header={{
|
|
@@ -287,9 +288,10 @@ const LoanIntegration: React.FC = () => {
|
|
|
name="checkInto"
|
|
|
title="撞库"
|
|
|
grid
|
|
|
- request={handleQueryCheckintoEndpoint}
|
|
|
+ request={handleQueryCheckintoChannel}
|
|
|
onFinish={async (formData) => {
|
|
|
- setCheckIntoFormData(handleEndpointFormData(checkintoEndpointId, formData));
|
|
|
+ let checkintoFormData = handleChannelFormData(checkintoChannelId, formData);
|
|
|
+ setCheckIntoFormData(checkintoFormData);
|
|
|
return true;
|
|
|
}}
|
|
|
>
|
|
@@ -310,12 +312,12 @@ const LoanIntegration: React.FC = () => {
|
|
|
},
|
|
|
]}
|
|
|
onChange={(value) => {
|
|
|
- setCiEndpointIntegrationMode(value);
|
|
|
+ setCiChannelIntegrationMode(value);
|
|
|
}}
|
|
|
/>
|
|
|
</ProCard>
|
|
|
<ProCard title="请求配置" bordered style={{ marginTop: '5px' }}>
|
|
|
- {ciEndpointIntegrationMode === 'customize' ? (
|
|
|
+ {ciChannelIntegrationMode === 'customize' ? (
|
|
|
<div style={{ width: '85vw' }}>
|
|
|
<ProFormTextArea
|
|
|
label="请求配置参数"
|
|
@@ -335,7 +337,7 @@ const LoanIntegration: React.FC = () => {
|
|
|
<HttpClient />
|
|
|
)}
|
|
|
</ProCard>
|
|
|
- {ciEndpointIntegrationMode === 'customize' ? (
|
|
|
+ {ciChannelIntegrationMode === 'customize' ? (
|
|
|
<div />
|
|
|
) : (
|
|
|
<ProCard title="响应配置" bordered style={{ marginTop: '5px' }}>
|
|
@@ -364,12 +366,12 @@ const LoanIntegration: React.FC = () => {
|
|
|
name="apply"
|
|
|
title="注册"
|
|
|
wrapperCol={{ span: 24 }}
|
|
|
- request={handleQueryApplyEndpoint}
|
|
|
+ request={handleQueryApplyChannel}
|
|
|
grid
|
|
|
onFinish={async (formData) => {
|
|
|
setPageLoading(true);
|
|
|
let locationStateData = location.state as { id: string; from: string };
|
|
|
- let applyFormData = handleEndpointFormData(applyEndpointId, formData);
|
|
|
+ let applyFormData = handleChannelFormData(applyChannelId, formData);
|
|
|
loanApiIntegration({
|
|
|
apiId: locationStateData.id,
|
|
|
apiLoanInfo: mainFormRef.current?.getFieldFormatValueObject?.() as ApiLoan,
|
|
@@ -378,11 +380,11 @@ const LoanIntegration: React.FC = () => {
|
|
|
})
|
|
|
.then((resp) => {
|
|
|
if (resp.success) {
|
|
|
- let toPathname = '/ui/egress/endpoint';
|
|
|
+ let toPathname = '/ui/gateway/egress/channel';
|
|
|
if (locationStateData.from === 'api') {
|
|
|
- toPathname = '/ui/egress/api';
|
|
|
+ toPathname = '/ui/gateway/egress/api';
|
|
|
}
|
|
|
- message.success('创建成功!');
|
|
|
+ message.success('操作成功!');
|
|
|
history.push({
|
|
|
pathname: toPathname,
|
|
|
});
|
|
@@ -412,12 +414,12 @@ const LoanIntegration: React.FC = () => {
|
|
|
},
|
|
|
]}
|
|
|
onChange={(value) => {
|
|
|
- setApyEndpointIntegrationMode(value);
|
|
|
+ setApyChannelIntegrationMode(value);
|
|
|
}}
|
|
|
/>
|
|
|
</ProCard>
|
|
|
<ProCard title="请求配置" bordered style={{ marginTop: '5px' }}>
|
|
|
- {apyEndpointIntegrationMode === 'customize' ? (
|
|
|
+ {apyChannelIntegrationMode === 'customize' ? (
|
|
|
<div style={{ width: '85vw' }}>
|
|
|
<ProFormTextArea
|
|
|
label="请求配置参数"
|
|
@@ -437,7 +439,7 @@ const LoanIntegration: React.FC = () => {
|
|
|
<HttpClient />
|
|
|
)}
|
|
|
</ProCard>
|
|
|
- {ciEndpointIntegrationMode === 'customize' ? (
|
|
|
+ {ciChannelIntegrationMode === 'customize' ? (
|
|
|
<div />
|
|
|
) : (
|
|
|
<ProCard title="响应配置" bordered style={{ marginTop: '5px' }}>
|