接口调试修改

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,8 +26,8 @@ export default [
}, },
{ {
name: '收款地址', name: '收款地址',
path: RoutePath.ADDRESS.LIST, path: RoutePath.WALLET.LIST,
component: './Recharge/Address/List', component: './Recharge/Wallet/List',
}, },
{ {
name: '代币种类', 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: '系统设置', name: '系统设置',
path: RoutePath.SYSTEM, path: RoutePath.SYSTEM,

View File

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

View File

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

View File

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

View File

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

View File

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