接口调试修改

This commit is contained in:
zzy 2022-08-24 15:03:09 +08:00
parent ca87af0bdc
commit 1cfda3b5b3
18 changed files with 77 additions and 74 deletions

View File

@ -11,7 +11,7 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
'/tbg/api/v1': {
// 要代理的地址
target: 'http://192.168.88.224:9999',
target: 'http://192.168.2.11:9999',
// 配置了这个可以从 http 代理到 https
// 依赖 origin 的功能可能需要这个,比如 cookie
changeOrigin: true,

View File

@ -35,7 +35,7 @@ const AddCoinTypeModal = ({ onOk, onCancel, ...rest }: AddCoinTypeModalPropsType
<Form form={form} labelCol={4} wrapperCol={18}>
<SchemaField>
<SchemaField.String
name="bc_name"
name="name"
title="代币名称"
required
x-decorator="FormItem"

View File

@ -45,7 +45,7 @@ const EditCoinTypeModal = ({
<Form form={form} labelCol={4} wrapperCol={18}>
<SchemaField>
<SchemaField.String
name="bc_name"
name="name"
title="游戏币名称"
x-disabled
x-decorator="FormItem"

View File

@ -21,7 +21,7 @@ const CoinTypeList = () => {
const columns: ProColumns<any>[] = [
{
title: '游戏币名称',
dataIndex: 'bc_name',
dataIndex: 'name',
hideInSearch: true,
ellipsis: true,
},

View File

@ -36,7 +36,7 @@ const RecordList = () => {
},
{
title: '游戏币类型',
dataIndex: 'bc_type',
dataIndex: 'name',
width: '10%',
hideInSearch: true,
},

View File

@ -7,7 +7,7 @@ import Modal, { ModalProps } from '@/components/Modal';
import { Form, FormItem, Input, Select } from '@formily/antd';
import { action } from '@formily/reactive';
interface AddAddressModalPropsType extends ModalProps {
interface AddWalletModalPropsType extends ModalProps {
onOk: (val: any) => void;
onCancel: () => void;
}
@ -36,14 +36,14 @@ const useAsyncDataSource = (
const form = createForm({
effects: () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
useAsyncDataSource('bc_name', async (field) => {
useAsyncDataSource('name', async (field) => {
const list = await getCoinTypeList({ page: 1, page_size: 10 });
const option = [];
for (let index = 0; index < list.items.length; index++) {
const element = list.items[index];
const item = {
label: element.bc_name,
value: element.bc_name,
label: element.name,
value: element.name,
};
option.push(item);
}
@ -52,7 +52,7 @@ const form = createForm({
},
});
const AddAddressModal = ({ onOk, onCancel, ...rest }: AddAddressModalPropsType) => {
const AddWalletModal = ({ onOk, onCancel, ...rest }: AddWalletModalPropsType) => {
const handleOk = () => {
const formState = form.getFormState();
onOk(formState.values);
@ -67,7 +67,7 @@ const AddAddressModal = ({ onOk, onCancel, ...rest }: AddAddressModalPropsType)
<FormProvider form={form}>
<SchemaField>
<SchemaField.String
name="bc_name"
name="name"
title="游戏币名称"
required
x-decorator="FormItem"
@ -94,4 +94,4 @@ const AddAddressModal = ({ onOk, onCancel, ...rest }: AddAddressModalPropsType)
);
};
export default AddAddressModal;
export default AddWalletModal;

View File

@ -7,7 +7,7 @@ import Modal, { ModalProps } from '@/components/Modal';
import { Form, FormItem, Input, Select } from '@formily/antd';
import { action } from '@formily/reactive';
interface EditAddressModalPropsType extends ModalProps {
interface EditWalletModalPropsType extends ModalProps {
editModalData: any;
onOk: (val: any) => void;
onCancel: () => void;
@ -21,12 +21,7 @@ const SchemaField = createSchemaField({
},
});
const EditAddressModal = ({
onOk,
onCancel,
editModalData,
...rest
}: EditAddressModalPropsType) => {
const EditWalletModal = ({ onOk, onCancel, editModalData, ...rest }: EditWalletModalPropsType) => {
const useAsyncDataSource = (
pattern: FormPathPattern,
service: (field: Field) => Promise<{ label: string; value: any }[]>,
@ -43,14 +38,14 @@ const EditAddressModal = ({
const form = createForm({
effects: () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
useAsyncDataSource('bc_name', async (field) => {
useAsyncDataSource('name', async (field) => {
const list = await getCoinTypeList({ page: 1, page_size: 10 });
const option = [];
for (let index = 0; index < list.items.length; index++) {
const element = list.items[index];
const item = {
label: element.bc_name,
value: element.bc_name,
label: element.name,
value: element.name,
};
option.push(item);
}
@ -84,7 +79,7 @@ const EditAddressModal = ({
x-component="Input"
/>
<SchemaField.String
name="bc_name"
name="name"
title="游戏币名称"
required
x-decorator="FormItem"
@ -103,4 +98,4 @@ const EditAddressModal = ({
);
};
export default EditAddressModal;
export default EditWalletModal;

View File

@ -5,12 +5,12 @@ import {
deleteAddress,
createAddress,
modifyAddress,
} from '@/services/recharge/address';
} from '@/services/recharge/wallet';
import { fetchTableData } from '@/utils/table';
import DeleteButton from '@/components/Table/DeleteButton';
import AddAddressModal from '../Components/AddAddressModal';
import EditAddressModal from '../Components/EditAddressModal';
import AddWalletModal from '../Components/AddWalletModal';
import EditWalletModal from '../Components/EditWalletModal';
const CollectionAddressList = () => {
const tableRef = useRef<ActionType>();
@ -39,7 +39,7 @@ const CollectionAddressList = () => {
},
{
title: '收款游戏币名称',
dataIndex: 'bc_name',
dataIndex: 'name',
hideInSearch: true,
ellipsis: true,
},
@ -84,7 +84,7 @@ const CollectionAddressList = () => {
return res;
}}
/>
<AddAddressModal
<AddWalletModal
visible={isModalVisible}
onCancel={function () {
setIsModalVisible(false);
@ -95,7 +95,7 @@ const CollectionAddressList = () => {
tableRef.current?.reload();
}}
/>
<EditAddressModal
<EditWalletModal
visible={isEditModalVisible}
editModalData={modalData}
onCancel={function () {

View File

@ -12,8 +12,6 @@ const WithdrawList = () => {
await solveWithdraw({ uuid: uuid });
};
const handlePass = async (row) => {};
const tableRef = useRef<ActionType>();
const columns: ProColumns<any>[] = [
{
@ -56,20 +54,12 @@ const WithdrawList = () => {
render: (_, row) => [
<ConfirmButton
key="confirm"
title="确认通知已提现?"
buttonName="通"
title="确认通提现?"
buttonName="通"
onConfirm={() => {
handleConfirm(row.uuid);
}}
/>,
<a
key="pass"
onClick={() => {
handlePass(row);
}}
>
</a>,
],
},
];

View File

@ -17,7 +17,7 @@ const PermissionsList = () => {
},
{
title: '收款游戏币类型',
dataIndex: 'bc_type',
dataIndex: 'type',
hideInSearch: true,
ellipsis: true,
},

View File

@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Button, Input } from 'antd';
import { Button, Input, Popconfirm } from 'antd';
import styles from './index.less';
import { createSecretKey, getSecretKey } from '@/services/system/secretKey';
@ -24,9 +24,12 @@ const SecretKey: React.FC = () => {
return (
<div className={styles.container}>
<Button className={styles.button} type="primary" onClick={create}>
</Button>
<Popconfirm title="确定创建密钥?" onConfirm={create} okText="确定" cancelText="取消">
<Button className={styles.button} type="primary">
</Button>
</Popconfirm>
<TextArea className={styles.textarea} rows={16} value={secretKey} />
</div>
);

View File

@ -17,12 +17,6 @@ const UserManageList = () => {
hideInSearch: true,
ellipsis: true,
},
{
title: '注册时间',
dataIndex: 'first_time',
hideInSearch: true,
ellipsis: true,
},
];
return (
<Table

View File

@ -26,8 +26,8 @@ export default [
},
{
name: '收款地址',
path: RoutePath.ADDRESS.LIST,
component: './Recharge/Address/List',
path: RoutePath.WALLET.LIST,
component: './Recharge/Wallet/List',
},
{
name: '代币种类',
@ -41,6 +41,22 @@ export default [
},
],
},
{
name: '用户账号',
path: RoutePath.USER,
routes: [
{
path: RoutePath.USER,
redirect: RoutePath.USER_LIST.LIST,
hideInMenu: true,
},
{
name: '用户账号管理',
path: RoutePath.USER_LIST.LIST,
component: './User/List',
},
],
},
{
name: '系统设置',
path: RoutePath.SYSTEM,

View File

@ -1,5 +1,6 @@
const SETTING = '/setting';
const RECHARGE = '/recharge';
const USER = '/user';
const SYSTEM = '/system';
const RoutePath = {
LOGIN: '/login',
@ -7,8 +8,8 @@ const RoutePath = {
RECORD: {
LIST: `${RECHARGE}/record`,
},
ADDRESS: {
LIST: `${RECHARGE}/address`,
WALLET: {
LIST: `${RECHARGE}/wallet`,
},
COIN_TYPE: {
LIST: `${RECHARGE}/coin_type`,
@ -16,6 +17,10 @@ const RoutePath = {
WITHDRAW: {
LIST: `${RECHARGE}/withdraw`,
},
USER: USER,
USER_LIST: {
LIST: `${USER}/user`,
},
SYSTEM: SYSTEM,
ACCOUNT: {
LIST: `${SYSTEM}/account`,

View File

@ -5,8 +5,8 @@ import request from '@/utils/request';
* @param {object} params
* type
* @returns {array} data
* bc_name
* bc_type
* name
* type
* usdt_price usdt的比例
* eth_price eth的比例
*/
@ -21,7 +21,7 @@ export const getCoinTypeList = (params) => {
/**
*
* @param {object} params
* bc_name
* name
* usdt_price usdt的比例
* eth_price eth的比例
* num
@ -38,8 +38,8 @@ export const addCoinType = (data) => {
/**
*
* @param {object} params
* bc_name
* bc_type
* name
* type
* usdt_price usdt的比例
* eth_price eth的比例
* @returns {object} data

View File

@ -8,7 +8,7 @@ import request from '@/utils/request';
* start_time
* end_time
* @returns {array} data
* bc_type
* type
* address
*/
export const getRecordList = (data) => {

View File

@ -4,12 +4,12 @@ import request from '@/utils/request';
*
* @param {object} params
* @returns {array} data
* bc_type
* type
* address
*/
export const getAddressList = (params) => {
return request.request({
url: '/address/get',
url: '/wallet/get',
method: 'get',
params,
});
@ -18,13 +18,13 @@ export const getAddressList = (params) => {
/**
*
* @param {Object} data
* bc_type
* type
* address ()
* @returns
*/
export const createAddress = (data) => {
return request.request({
url: '/address/create',
url: '/wallet/create',
method: 'post',
data,
});
@ -38,7 +38,7 @@ export const createAddress = (data) => {
*/
export const deleteAddress = (data) => {
return request.request({
url: '/address/delete',
url: '/wallet/delete',
method: 'post',
data,
});
@ -48,13 +48,13 @@ export const deleteAddress = (data) => {
*
* @param {Object} data
* address
* bc_type
* type
* new_address
* @returns
*/
export const modifyAddress = (data) => {
return request.request({
url: '/address/update',
url: '/wallet/update',
method: 'post',
data,
});

View File

@ -2,15 +2,15 @@ import request from '@/utils/request';
/**
*
* @param {object} params
* @param {object} data
* @returns {array} data
* role_name
* role
*/
export const getUserList = (params) => {
export const getUserList = (data) => {
return request.request({
url: '/account/get',
method: 'get',
params,
method: 'post',
data,
});
};