WIP: user-zzy-dev #1
|
|
@ -11,7 +11,7 @@ export default {
|
|||
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
|
||||
'/tbg/api/v1': {
|
||||
// 要代理的地址
|
||||
target: 'http://0.0.0.0:9999',
|
||||
target: 'http://192.168.88.224:9999',
|
||||
// 配置了这个可以从 http 代理到 https
|
||||
// 依赖 origin 的功能可能需要这个,比如 cookie
|
||||
changeOrigin: true,
|
||||
|
|
|
|||
|
|
@ -60,10 +60,11 @@
|
|||
"ahooks": "^2.10.14",
|
||||
"antd": "^4.17.2",
|
||||
"axios": "^0.24.0",
|
||||
"bignumber.js": "^9.0.0",
|
||||
"braft-editor": "^2.3.9",
|
||||
"classnames": "^2.2.6",
|
||||
"lodash": "^4.17.11",
|
||||
"moment": "^2.25.3",
|
||||
"moment": "^2.29.4",
|
||||
"omit.js": "^2.0.2",
|
||||
"rc-menu": "^9.0.13",
|
||||
"rc-util": "^5.14.0",
|
||||
|
|
@ -72,8 +73,7 @@
|
|||
"react-dom": "^17.0.0",
|
||||
"react-helmet-async": "^1.0.4",
|
||||
"umi": "^3.5.0",
|
||||
"umi-serve": "^1.9.10",
|
||||
"bignumber.js": "^9.0.0"
|
||||
"umi-serve": "^1.9.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ant-design/pro-cli": "^2.0.2",
|
||||
|
|
|
|||
|
|
@ -6,25 +6,30 @@ import {
|
|||
createAddress,
|
||||
modifyAddress,
|
||||
} from '@/services/Recharge/address';
|
||||
|
||||
import { fetchTableData } from '@/utils/table';
|
||||
import DeleteButton from '@/components/Table/DeleteButton';
|
||||
import AddAddressModal from './components/addAddressModal';
|
||||
import EditAddressModal from './components/editAddressModal';
|
||||
import AddAddressModal from '../components/addAddressModal';
|
||||
import EditAddressModal from '../components/editAddressModal';
|
||||
|
||||
const CollectionAddressList = () => {
|
||||
const tableRef = useRef<ActionType>();
|
||||
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [isEditModalVisible, setIsEditModalVisible] = useState(false);
|
||||
const [modalData, setModalData] = useState({});
|
||||
|
||||
const handleEdit = (row: any) => {
|
||||
row.new_address = '';
|
||||
setModalData(row);
|
||||
setIsEditModalVisible(true);
|
||||
};
|
||||
|
||||
const handleDelete = async (address: any) => {
|
||||
await deleteAddress({ address: address });
|
||||
tableRef.current?.reload();
|
||||
};
|
||||
const tableRef = useRef<ActionType>();
|
||||
|
||||
const columns: ProColumns<any>[] = [
|
||||
{
|
||||
title: '收款地址',
|
||||
|
|
@ -33,8 +38,8 @@ const CollectionAddressList = () => {
|
|||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '收款游戏币类型',
|
||||
dataIndex: 'bc_type',
|
||||
title: '收款游戏币名称',
|
||||
dataIndex: 'bc_name',
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
|
|
@ -87,6 +92,7 @@ const CollectionAddressList = () => {
|
|||
onOk={async function (val: any): Promise<void> {
|
||||
await createAddress(val);
|
||||
setIsModalVisible(false);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
<EditAddressModal
|
||||
|
|
@ -98,6 +104,7 @@ const CollectionAddressList = () => {
|
|||
onOk={async function (val: any): Promise<void> {
|
||||
await modifyAddress(val);
|
||||
setIsEditModalVisible(false);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
// 创建弹窗
|
||||
import React, { useRef } from 'react';
|
||||
import { createForm, onFieldReact, FormPathPattern, Field } from '@formily/core';
|
||||
import { FormProvider, createSchemaField } from '@formily/react';
|
||||
import { getCoinTypeList } from '@/services/Recharge/coinType';
|
||||
import Modal, { ModalProps } from '@/components/Modal';
|
||||
import { Form, FormItem, Input, Select } from '@formily/antd';
|
||||
import { action } from '@formily/reactive';
|
||||
|
||||
interface AddAddressModalPropsType extends ModalProps {
|
||||
onOk: (val: any) => void;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
const SchemaField = createSchemaField({
|
||||
components: {
|
||||
FormItem,
|
||||
Input,
|
||||
Select,
|
||||
},
|
||||
});
|
||||
|
||||
const useAsyncDataSource = (
|
||||
pattern: FormPathPattern,
|
||||
service: (field: Field) => Promise<{ label: string; value: any }[]>,
|
||||
) => {
|
||||
onFieldReact(pattern, (field) => {
|
||||
service(field).then(
|
||||
action.bound((data) => {
|
||||
field.dataSource = data;
|
||||
}),
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const form = createForm({
|
||||
effects: () => {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
useAsyncDataSource('bc_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,
|
||||
};
|
||||
option.push(item);
|
||||
}
|
||||
return option;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const AddAddressModal = ({ onOk, onCancel, ...rest }: AddAddressModalPropsType) => {
|
||||
const handleOk = () => {
|
||||
const formState = form.getFormState();
|
||||
onOk(formState.values);
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal title="创建收款地址" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
||||
<FormProvider form={form}>
|
||||
<SchemaField>
|
||||
<SchemaField.String
|
||||
name="bc_name"
|
||||
title="游戏币名称"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Select"
|
||||
x-component-props={{
|
||||
placeholder: '',
|
||||
}}
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="address"
|
||||
title="收款地址"
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
x-component-props={{
|
||||
placeholder: '不传则后台生成',
|
||||
}}
|
||||
/>
|
||||
</SchemaField>
|
||||
</FormProvider>
|
||||
{/* <Form form={form} labelCol={4} wrapperCol={18}> */}
|
||||
|
||||
{/* </Form> */}
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default AddAddressModal;
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
// 修改弹窗
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import { createForm, onFieldReact, FormPathPattern, Field } from '@formily/core';
|
||||
import { getCoinTypeList } from '@/services/Recharge/coinType';
|
||||
import { FormProvider, createSchemaField } from '@formily/react';
|
||||
import Modal, { ModalProps } from '@/components/Modal';
|
||||
import { Form, FormItem, Input, Select } from '@formily/antd';
|
||||
import { action } from '@formily/reactive';
|
||||
|
||||
interface EditAddressModalPropsType extends ModalProps {
|
||||
editModalData: any;
|
||||
onOk: (val: any) => void;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
const SchemaField = createSchemaField({
|
||||
components: {
|
||||
FormItem,
|
||||
Input,
|
||||
Select,
|
||||
},
|
||||
});
|
||||
|
||||
const EditAddressModal = ({
|
||||
onOk,
|
||||
onCancel,
|
||||
editModalData,
|
||||
...rest
|
||||
}: EditAddressModalPropsType) => {
|
||||
const useAsyncDataSource = (
|
||||
pattern: FormPathPattern,
|
||||
service: (field: Field) => Promise<{ label: string; value: any }[]>,
|
||||
) => {
|
||||
onFieldReact(pattern, (field) => {
|
||||
service(field).then(
|
||||
action.bound((data) => {
|
||||
field.dataSource = data;
|
||||
}),
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const form = createForm({
|
||||
effects: () => {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
useAsyncDataSource('bc_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,
|
||||
};
|
||||
option.push(item);
|
||||
}
|
||||
return option;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
form.setInitialValues(editModalData);
|
||||
});
|
||||
|
||||
const handleOk = () => {
|
||||
const formState = form.getFormState();
|
||||
onOk(formState.values);
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal title="修改收款地址" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
||||
<Form form={form} labelCol={4} wrapperCol={18}>
|
||||
<SchemaField>
|
||||
<SchemaField.String
|
||||
name="address"
|
||||
title="旧收款地址"
|
||||
x-disabled
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="bc_name"
|
||||
title="游戏币名称"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Select"
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="new_address"
|
||||
title="新收款地址"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
</SchemaField>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default EditAddressModal;
|
||||
|
|
@ -2,10 +2,12 @@ import React, { useState, useRef } from 'react';
|
|||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||
import { addCoinType, getCoinTypeList, modifyCoinType } from '@/services/Recharge/coinType';
|
||||
import { fetchTableData } from '@/utils/table';
|
||||
import AddCoinTypeModal from './components/addCoinTypeModal';
|
||||
import EditCoinTypeModal from './components/editCoinTypeModal';
|
||||
import AddCoinTypeModal from '../components/addCoinTypeModal';
|
||||
import EditCoinTypeModal from '../components/editCoinTypeModal';
|
||||
|
||||
const CoinTypeList = () => {
|
||||
const tableRef = useRef<ActionType>();
|
||||
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [isEditModalVisible, setIsEditModalVisible] = useState(false);
|
||||
const [modalData, setModalData] = useState({});
|
||||
|
|
@ -13,9 +15,9 @@ const CoinTypeList = () => {
|
|||
const handleEdit = (row: any) => {
|
||||
setModalData(row);
|
||||
setIsEditModalVisible(true);
|
||||
tableRef.current?.reload();
|
||||
};
|
||||
|
||||
const tableRef = useRef<ActionType>();
|
||||
const columns: ProColumns<any>[] = [
|
||||
{
|
||||
title: '游戏币名称',
|
||||
|
|
@ -23,12 +25,6 @@ const CoinTypeList = () => {
|
|||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '游戏币类型',
|
||||
dataIndex: 'bc_type',
|
||||
width: '10%',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: 'usdt比例',
|
||||
dataIndex: 'usdt_price',
|
||||
|
|
@ -41,6 +37,12 @@ const CoinTypeList = () => {
|
|||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '代币发行总量',
|
||||
dataIndex: 'num',
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
|
|
@ -84,6 +86,7 @@ const CoinTypeList = () => {
|
|||
onOk={async function (val: any): Promise<void> {
|
||||
await addCoinType(val);
|
||||
setIsModalVisible(false);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
<EditCoinTypeModal
|
||||
|
|
@ -95,6 +98,7 @@ const CoinTypeList = () => {
|
|||
onOk={async function (val: any): Promise<void> {
|
||||
await modifyCoinType(val);
|
||||
setIsEditModalVisible(false);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -35,8 +35,9 @@ const AddCoinTypeModal = ({ onOk, onCancel, ...rest }: AddCoinTypeModalPropsType
|
|||
<Form form={form} labelCol={4} wrapperCol={18}>
|
||||
<SchemaField>
|
||||
<SchemaField.String
|
||||
name="name"
|
||||
name="bc_name"
|
||||
title="代币名称"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
|
|
@ -50,12 +51,14 @@ const AddCoinTypeModal = ({ onOk, onCancel, ...rest }: AddCoinTypeModalPropsType
|
|||
<SchemaField.String
|
||||
name="eth_price"
|
||||
title="eth比例"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
<SchemaField.Number
|
||||
name="num"
|
||||
title="数量"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="NumberPicker"
|
||||
/>
|
||||
|
|
@ -47,16 +47,10 @@ const EditCoinTypeModal = ({
|
|||
<SchemaField.String
|
||||
name="bc_name"
|
||||
title="游戏币名称"
|
||||
x-disabled
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="bc_type"
|
||||
title="游戏币类型"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Select"
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="usdt_price"
|
||||
title="usdt比例"
|
||||
|
|
@ -4,6 +4,7 @@ import { getRecordList } from '@/services/Recharge/record';
|
|||
import { fetchTableData } from '@/utils/table';
|
||||
import { getBalanceAmount } from '@/utils/formatBalance';
|
||||
import BigNumber from 'bignumber.js';
|
||||
import moment from 'moment';
|
||||
|
||||
const RecordList = () => {
|
||||
const tableRef = useRef<ActionType>();
|
||||
|
|
@ -41,7 +42,7 @@ const RecordList = () => {
|
|||
},
|
||||
{
|
||||
title: '发送地址',
|
||||
dataIndex: 'form_address',
|
||||
dataIndex: 'from_address',
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
|
|
@ -64,11 +65,15 @@ const RecordList = () => {
|
|||
rowKey="id"
|
||||
actionRef={tableRef}
|
||||
request={async (params) => {
|
||||
console.log('params = ', params);
|
||||
if ((params.time ?? '') !== '') {
|
||||
params.start_time = params.time[0];
|
||||
params.end_time = params.time[1];
|
||||
const start = Date.parse(params.time[0] + ' 00:00:00');
|
||||
const end = Date.parse(params.time[1] + ' 23:59:59');
|
||||
params.start_time = start / 1000;
|
||||
params.end_time = end / 1000;
|
||||
}
|
||||
const res = await fetchTableData(getRecordList, params);
|
||||
console.log('res = ', res);
|
||||
for (const key in res.data) {
|
||||
if (Object.prototype.hasOwnProperty.call(res.data, key)) {
|
||||
const element = res.data[key];
|
||||
|
|
@ -76,6 +81,7 @@ const RecordList = () => {
|
|||
new BigNumber(element.price),
|
||||
element.decimals,
|
||||
).toNumber();
|
||||
element.time = moment(element.time * 1000).format('YYYY-MM-DD hh:mm:ss');
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -5,12 +5,15 @@ import { fetchTableData } from '@/utils/table';
|
|||
import { getBalanceAmount } from '@/utils/formatBalance';
|
||||
import BigNumber from 'bignumber.js';
|
||||
import ConfirmButton from '@/components/Table/ConfirmButton';
|
||||
import moment from 'moment';
|
||||
|
||||
const WithdrawList = () => {
|
||||
const handleConfirm = async (uuid) => {
|
||||
await solveWithdraw({ uuid: uuid });
|
||||
};
|
||||
|
||||
const handlePass = async (row) => {};
|
||||
|
||||
const tableRef = useRef<ActionType>();
|
||||
const columns: ProColumns<any>[] = [
|
||||
{
|
||||
|
|
@ -25,19 +28,7 @@ const WithdrawList = () => {
|
|||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '位数',
|
||||
dataIndex: 'decimals',
|
||||
width: '10%',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '发送地址',
|
||||
dataIndex: 'form_address',
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '接受地址',
|
||||
title: '接收地址',
|
||||
dataIndex: 'to_address',
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
|
|
@ -47,6 +38,11 @@ const WithdrawList = () => {
|
|||
dataIndex: 'bc_type',
|
||||
width: '10%',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
width: '10%',
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'time',
|
||||
|
|
@ -66,6 +62,14 @@ const WithdrawList = () => {
|
|||
handleConfirm(row.uuid);
|
||||
}}
|
||||
/>,
|
||||
<a
|
||||
key="pass"
|
||||
onClick={() => {
|
||||
handlePass(row);
|
||||
}}
|
||||
>
|
||||
通过
|
||||
</a>,
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
@ -76,7 +80,6 @@ const WithdrawList = () => {
|
|||
rowKey="id"
|
||||
actionRef={tableRef}
|
||||
request={async (params) => {
|
||||
console.log('params = ', params);
|
||||
const res = await fetchTableData(getWithdrawList, params);
|
||||
for (const key in res.data) {
|
||||
if (Object.prototype.hasOwnProperty.call(res.data, key)) {
|
||||
|
|
@ -85,6 +88,7 @@ const WithdrawList = () => {
|
|||
new BigNumber(element.price),
|
||||
element.decimals,
|
||||
).toNumber();
|
||||
element.time = moment(element.time * 1000).format('YYYY-MM-DD hh:mm:ss');
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
import React, { useState, useRef } from 'react';
|
||||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||
import { getAccountList, deleteUser } from '@/services/System/accountManage';
|
||||
import {
|
||||
getAccountList,
|
||||
deleteUser,
|
||||
updateUser,
|
||||
changeUserStatus,
|
||||
} from '@/services/System/accountManage';
|
||||
import { fetchTableData } from '@/utils/table';
|
||||
import DeleteButton from '@/components/Table/DeleteButton';
|
||||
import { Switch } from 'antd';
|
||||
import AddAccountModal from '../components/addAccountModal';
|
||||
import EditAccountModal from '../components/editAccountModal';
|
||||
|
||||
const AccountManageList = () => {
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
|
|
@ -14,13 +20,11 @@ const AccountManageList = () => {
|
|||
const handleEdit = (row: any) => {
|
||||
setModalData(row);
|
||||
setIsEditModal(true);
|
||||
setIsModalVisible(true);
|
||||
};
|
||||
|
||||
const handleDelete = async (name: any) => {
|
||||
await deleteUser({ name: name });
|
||||
};
|
||||
const onChange = (checked: boolean) => {};
|
||||
const tableRef = useRef<ActionType>();
|
||||
const columns: ProColumns<any>[] = [
|
||||
{
|
||||
|
|
@ -35,12 +39,6 @@ const AccountManageList = () => {
|
|||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '用户状态',
|
||||
dataIndex: 'status',
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
|
|
@ -54,11 +52,19 @@ const AccountManageList = () => {
|
|||
>
|
||||
编辑
|
||||
</a>,
|
||||
<Switch key="switch" defaultChecked={row.status} size="small" onChange={onChange} />,
|
||||
<Switch
|
||||
key="switch"
|
||||
defaultChecked={row.status}
|
||||
size="small"
|
||||
onChange={async (checked) => {
|
||||
await changeUserStatus({ name: row.name, status: checked });
|
||||
}}
|
||||
/>,
|
||||
<DeleteButton
|
||||
key="delete"
|
||||
onDelete={() => {
|
||||
handleDelete(row.name);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>,
|
||||
],
|
||||
|
|
@ -85,13 +91,23 @@ const AccountManageList = () => {
|
|||
/>
|
||||
<AddAccountModal
|
||||
visible={isModalVisible}
|
||||
isEdit={isEditModal}
|
||||
editModalData={modalData}
|
||||
onCancel={function () {
|
||||
setIsModalVisible(false);
|
||||
}}
|
||||
onOk={async function (): Promise<void> {
|
||||
setIsModalVisible(false);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
<EditAccountModal
|
||||
visible={isEditModal}
|
||||
editModalData={modalData}
|
||||
onCancel={function () {
|
||||
setIsEditModal(false);
|
||||
}}
|
||||
onOk={async function (): Promise<void> {
|
||||
setIsEditModal(false);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
// 创建弹窗
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import React, { useRef } from 'react';
|
||||
import { createForm } from '@formily/core';
|
||||
import { createSchemaField } from '@formily/react';
|
||||
import Modal, { ModalProps } from '@/components/Modal';
|
||||
import { Form, FormItem, Input, Select } from '@formily/antd';
|
||||
import { addUser } from '@/services/System/accountManage';
|
||||
|
||||
interface AddUserModalPropsType extends ModalProps {
|
||||
isEdit: boolean;
|
||||
editModalData: any;
|
||||
interface AddAccountModalPropsType extends ModalProps {
|
||||
onCancel: () => void;
|
||||
onOk: () => void;
|
||||
}
|
||||
|
|
@ -23,15 +21,14 @@ const SchemaField = createSchemaField({
|
|||
|
||||
const form = createForm({});
|
||||
|
||||
const AddUserModal = ({ onOk, onCancel, editModalData, ...rest }: AddUserModalPropsType) => {
|
||||
useEffect(() => {
|
||||
form.setInitialValues(editModalData);
|
||||
});
|
||||
|
||||
const AddAccountModal = ({ onOk, onCancel, ...rest }: AddAccountModalPropsType) => {
|
||||
const handleOk = async () => {
|
||||
form.submit(async () => {
|
||||
onOk();
|
||||
const formState = form.getFormState();
|
||||
formState.values.role = parseInt(formState.values.role);
|
||||
await addUser(formState.values);
|
||||
});
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
|
|
@ -56,6 +53,9 @@ const AddUserModal = ({ onOk, onCancel, editModalData, ...rest }: AddUserModalPr
|
|||
name="password"
|
||||
title="密码"
|
||||
required
|
||||
x-validator={{
|
||||
required: true,
|
||||
}}
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
x-component-props={{
|
||||
|
|
@ -66,8 +66,11 @@ const AddUserModal = ({ onOk, onCancel, editModalData, ...rest }: AddUserModalPr
|
|||
name="role"
|
||||
title="角色"
|
||||
required
|
||||
x-validator={{
|
||||
required: true,
|
||||
}}
|
||||
x-decorator="FormItem"
|
||||
x-component="Select"
|
||||
x-component="Input"
|
||||
x-component-props={{
|
||||
placeholder: '请选择角色',
|
||||
}}
|
||||
|
|
@ -78,4 +81,4 @@ const AddUserModal = ({ onOk, onCancel, editModalData, ...rest }: AddUserModalPr
|
|||
);
|
||||
};
|
||||
|
||||
export default AddUserModal;
|
||||
export default AddAccountModal;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
// 创建弹窗
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import { createForm } from '@formily/core';
|
||||
import { createSchemaField } from '@formily/react';
|
||||
import Modal, { ModalProps } from '@/components/Modal';
|
||||
import { Form, FormItem, Input, Select } from '@formily/antd';
|
||||
import { addUser, updateUser } from '@/services/System/accountManage';
|
||||
|
||||
interface AddUserModalPropsType extends ModalProps {
|
||||
editModalData: any;
|
||||
onCancel: () => void;
|
||||
onOk: () => void;
|
||||
}
|
||||
|
||||
const SchemaField = createSchemaField({
|
||||
components: {
|
||||
FormItem,
|
||||
Input,
|
||||
Select,
|
||||
},
|
||||
});
|
||||
|
||||
const form = createForm({});
|
||||
|
||||
const AddUserModal = ({ onOk, onCancel, editModalData, ...rest }: AddUserModalPropsType) => {
|
||||
useEffect(() => {
|
||||
form.setInitialValues(editModalData);
|
||||
});
|
||||
|
||||
const handleOk = async () => {
|
||||
onOk();
|
||||
const formState = form.getFormState();
|
||||
formState.values.role = parseInt(formState.values.role);
|
||||
await updateUser(formState.values);
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal title="编辑管理账号" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
||||
<Form form={form} labelCol={4} wrapperCol={18}>
|
||||
<SchemaField>
|
||||
<SchemaField.String
|
||||
name="name"
|
||||
title="账号名"
|
||||
required
|
||||
x-disabled
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
x-component-props={{
|
||||
placeholder: '请输入账号名',
|
||||
}}
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="password"
|
||||
title="密码"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
x-component-props={{
|
||||
placeholder: '请输入密码',
|
||||
}}
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="role"
|
||||
title="角色"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
x-component-props={{
|
||||
placeholder: '请选择角色',
|
||||
}}
|
||||
/>
|
||||
</SchemaField>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default AddUserModal;
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
import React, { useState, useRef } from 'react';
|
||||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||
import { getNoticeList, createNotice, updateNotice, deleteNotice } from '@/services/System/notice';
|
||||
import { fetchTableData } from '@/utils/table';
|
||||
import AddNoticeModal from '../components/addNoticeModal';
|
||||
import DeleteButton from '@/components/Table/DeleteButton';
|
||||
import { Switch } from 'antd';
|
||||
import EditNoticeModal from '../components/editNoticeModal';
|
||||
|
||||
const NoticeList = () => {
|
||||
const tableRef = useRef<ActionType>();
|
||||
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [isEditModalVisible, setIsEditModalVisible] = useState(false);
|
||||
const [modalData, setModalData] = useState({});
|
||||
|
||||
const handleEdit = (row: any) => {
|
||||
setModalData(row);
|
||||
setIsEditModalVisible(true);
|
||||
tableRef.current?.reload();
|
||||
};
|
||||
|
||||
const handleDelete = async (code: any) => {
|
||||
await deleteNotice({ code: code });
|
||||
tableRef.current?.reload();
|
||||
};
|
||||
|
||||
const columns: ProColumns<any>[] = [
|
||||
{
|
||||
title: '通知码',
|
||||
dataIndex: 'code',
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '通知地址',
|
||||
dataIndex: 'addr',
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
width: 180,
|
||||
render: (_, row) => [
|
||||
<a
|
||||
key="edit"
|
||||
onClick={() => {
|
||||
handleEdit(row);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>,
|
||||
<Switch
|
||||
key="switch"
|
||||
defaultChecked={row.status}
|
||||
size="small"
|
||||
onChange={async (checked) => {
|
||||
row.status = checked;
|
||||
await updateNotice(row);
|
||||
}}
|
||||
/>,
|
||||
<DeleteButton
|
||||
key="delete"
|
||||
onDelete={() => {
|
||||
handleDelete(row.code);
|
||||
}}
|
||||
/>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
toolBarActions={[
|
||||
{
|
||||
type: 'add',
|
||||
onConfirm: () => {
|
||||
setIsModalVisible(true);
|
||||
},
|
||||
},
|
||||
]}
|
||||
actionRef={tableRef}
|
||||
request={async (params) => {
|
||||
const res = await fetchTableData(getNoticeList, params);
|
||||
return res;
|
||||
}}
|
||||
/>
|
||||
<AddNoticeModal
|
||||
visible={isModalVisible}
|
||||
onCancel={function () {
|
||||
setIsModalVisible(false);
|
||||
}}
|
||||
onOk={async function (val: any): Promise<void> {
|
||||
await createNotice(val);
|
||||
setIsModalVisible(false);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
<EditNoticeModal
|
||||
visible={isEditModalVisible}
|
||||
editModalData={modalData}
|
||||
onCancel={function () {
|
||||
setIsEditModalVisible(false);
|
||||
}}
|
||||
onOk={async function (val: any): Promise<void> {
|
||||
await updateNotice(val);
|
||||
setIsEditModalVisible(false);
|
||||
tableRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default NoticeList;
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
// 创建弹窗
|
||||
// 添加代币类型弹窗
|
||||
import React, { useRef } from 'react';
|
||||
import { createForm } from '@formily/core';
|
||||
import { createSchemaField } from '@formily/react';
|
||||
import Modal, { ModalProps } from '@/components/Modal';
|
||||
import { Form, FormItem, Input, Select } from '@formily/antd';
|
||||
|
||||
interface AddAddressModalPropsType extends ModalProps {
|
||||
interface AddNoticeModalPropsType extends ModalProps {
|
||||
onOk: (val: any) => void;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
|
@ -20,9 +20,10 @@ const SchemaField = createSchemaField({
|
|||
|
||||
const form = createForm({});
|
||||
|
||||
const AddAddressModal = ({ onOk, onCancel, ...rest }: AddAddressModalPropsType) => {
|
||||
const AddNoticeModal = ({ onOk, onCancel, ...rest }: AddNoticeModalPropsType) => {
|
||||
const handleOk = () => {
|
||||
const formState = form.getFormState();
|
||||
formState.values.code = parseInt(formState.values.code);
|
||||
onOk(formState.values);
|
||||
};
|
||||
|
||||
|
|
@ -31,27 +32,33 @@ const AddAddressModal = ({ onOk, onCancel, ...rest }: AddAddressModalPropsType)
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal title="创建收款地址" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
||||
<Modal title="添加通知" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
||||
<Form form={form} labelCol={4} wrapperCol={18}>
|
||||
<SchemaField>
|
||||
<SchemaField.String
|
||||
name="bc_type"
|
||||
title="游戏币类型"
|
||||
name="code"
|
||||
title="通知码"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="addr"
|
||||
title="通知地址"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
<SchemaField.Boolean
|
||||
name="status"
|
||||
title="状态"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Select"
|
||||
x-component-props={{
|
||||
placeholder: '',
|
||||
}}
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="address"
|
||||
title="收款地址"
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
x-component-props={{
|
||||
placeholder: '不传则后台生成',
|
||||
}}
|
||||
enum={[
|
||||
{ label: '启用', value: true },
|
||||
{ label: '禁用', value: false },
|
||||
]}
|
||||
/>
|
||||
</SchemaField>
|
||||
</Form>
|
||||
|
|
@ -59,4 +66,4 @@ const AddAddressModal = ({ onOk, onCancel, ...rest }: AddAddressModalPropsType)
|
|||
);
|
||||
};
|
||||
|
||||
export default AddAddressModal;
|
||||
export default AddNoticeModal;
|
||||
|
|
@ -5,7 +5,7 @@ import { createSchemaField } from '@formily/react';
|
|||
import Modal, { ModalProps } from '@/components/Modal';
|
||||
import { Form, FormItem, Input, Select } from '@formily/antd';
|
||||
|
||||
interface EditAddressModalPropsType extends ModalProps {
|
||||
interface EditNoticeModalPropsType extends ModalProps {
|
||||
editModalData: any;
|
||||
onOk: (val: any) => void;
|
||||
onCancel: () => void;
|
||||
|
|
@ -21,12 +21,7 @@ const SchemaField = createSchemaField({
|
|||
|
||||
const form = createForm({});
|
||||
|
||||
const EditAddressModal = ({
|
||||
onOk,
|
||||
onCancel,
|
||||
editModalData,
|
||||
...rest
|
||||
}: EditAddressModalPropsType) => {
|
||||
const EditNoticeModal = ({ onOk, onCancel, editModalData, ...rest }: EditNoticeModalPropsType) => {
|
||||
useEffect(() => {
|
||||
form.setInitialValues(editModalData);
|
||||
});
|
||||
|
|
@ -41,26 +36,22 @@ const EditAddressModal = ({
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal title="修改收款地址" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
||||
<Modal title="修改通知" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
||||
<Form form={form} labelCol={4} wrapperCol={18}>
|
||||
<SchemaField>
|
||||
<SchemaField.String
|
||||
name="address"
|
||||
title="旧收款地址"
|
||||
name="code"
|
||||
title="通知码"
|
||||
x-disabled
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="bc_type"
|
||||
title="游戏币类型"
|
||||
name="addr"
|
||||
title="通知地址"
|
||||
required
|
||||
x-decorator="FormItem"
|
||||
x-component="Select"
|
||||
/>
|
||||
<SchemaField.String
|
||||
name="new_address"
|
||||
title="新收款地址"
|
||||
x-decorator="FormItem"
|
||||
x-component="Input"
|
||||
/>
|
||||
</SchemaField>
|
||||
|
|
@ -69,4 +60,4 @@ const EditAddressModal = ({
|
|||
);
|
||||
};
|
||||
|
||||
export default EditAddressModal;
|
||||
export default EditNoticeModal;
|
||||
|
|
@ -9,7 +9,8 @@ const SecretKey: React.FC = () => {
|
|||
const [secretKey, setSecretKey] = useState('');
|
||||
|
||||
const create = async () => {
|
||||
await createSecretKey({});
|
||||
const data = await createSecretKey({});
|
||||
setSecretKey(data + '');
|
||||
};
|
||||
|
||||
const getUserSecretKey = async () => {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,11 @@ export default [
|
|||
path: RoutePath.PERMISSIONS.LIST,
|
||||
component: './System/Permissions/List',
|
||||
},
|
||||
{
|
||||
name: '通知管理',
|
||||
path: RoutePath.NOTICE.LIST,
|
||||
component: './System/Notice/List',
|
||||
},
|
||||
{
|
||||
name: '密钥管理',
|
||||
path: RoutePath.SECRET_KEY,
|
||||
|
|
@ -72,31 +77,31 @@ export default [
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: '设置',
|
||||
path: RoutePath.SETTING,
|
||||
routes: [
|
||||
{
|
||||
path: RoutePath.SETTING,
|
||||
redirect: RoutePath.WORK.LIST,
|
||||
hideInMenu: true,
|
||||
},
|
||||
{
|
||||
name: '作品',
|
||||
path: RoutePath.WORK.LIST,
|
||||
component: './Work/List',
|
||||
},
|
||||
{
|
||||
name: '作品详情',
|
||||
path: RoutePath.WORK.EDIT,
|
||||
hideInMenu: true,
|
||||
component: './Work/Edit',
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// name: '设置',
|
||||
// path: RoutePath.SETTING,
|
||||
// routes: [
|
||||
// {
|
||||
// path: RoutePath.SETTING,
|
||||
// redirect: RoutePath.WORK.LIST,
|
||||
// hideInMenu: true,
|
||||
// },
|
||||
// {
|
||||
// name: '作品',
|
||||
// path: RoutePath.WORK.LIST,
|
||||
// component: './Work/List',
|
||||
// },
|
||||
// {
|
||||
// name: '作品详情',
|
||||
// path: RoutePath.WORK.EDIT,
|
||||
// hideInMenu: true,
|
||||
// component: './Work/Edit',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
path: '/',
|
||||
redirect: RoutePath.WORK.LIST,
|
||||
redirect: RoutePath.RECORD.LIST,
|
||||
},
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,12 +26,15 @@ const RoutePath = {
|
|||
PERMISSIONS: {
|
||||
LIST: `${SYSTEM}/permissions`,
|
||||
},
|
||||
SECRET_KEY: `${SYSTEM}/secret_key`,
|
||||
SETTING: SETTING,
|
||||
WORK: {
|
||||
LIST: `${SETTING}/work`,
|
||||
EDIT: `${SETTING}/work/edit`,
|
||||
NOTICE: {
|
||||
LIST: `${SYSTEM}/notice`,
|
||||
},
|
||||
SECRET_KEY: `${SYSTEM}/secret_key`,
|
||||
// SETTING: SETTING,
|
||||
// WORK: {
|
||||
// LIST: `${SETTING}/work`,
|
||||
// EDIT: `${SETTING}/work/edit`,
|
||||
// },
|
||||
};
|
||||
|
||||
export default RoutePath;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export const getAddressList = (params) => {
|
|||
*/
|
||||
export const createAddress = (data) => {
|
||||
return request.request({
|
||||
url: '/address/make',
|
||||
url: '/address/create',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
|
|
@ -38,7 +38,7 @@ export const createAddress = (data) => {
|
|||
*/
|
||||
export const deleteAddress = (data) => {
|
||||
return request.request({
|
||||
url: '/address/del',
|
||||
url: '/address/delete',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
|
|
@ -54,7 +54,7 @@ export const deleteAddress = (data) => {
|
|||
*/
|
||||
export const modifyAddress = (data) => {
|
||||
return request.request({
|
||||
url: '/address/del',
|
||||
url: '/address/update',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export const getCoinTypeList = (params) => {
|
|||
*/
|
||||
export const addCoinType = (data) => {
|
||||
return request.request({
|
||||
url: '/token/make',
|
||||
url: '/token/create',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
|
|
@ -46,7 +46,7 @@ export const addCoinType = (data) => {
|
|||
*/
|
||||
export const modifyCoinType = (data) => {
|
||||
return request.request({
|
||||
url: '/token/chg',
|
||||
url: '/token/update',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,28 +7,28 @@ import request from '@/utils/request';
|
|||
* @returns {array} data
|
||||
* uuid 提现订单id
|
||||
* to_addrss 接收地址
|
||||
* form_address 发送地址
|
||||
* from_address 发送地址
|
||||
* time 提现时间
|
||||
* price 提现金额
|
||||
*/
|
||||
export const getWithdrawList = (params) => {
|
||||
export const getWithdrawList = (data) => {
|
||||
return request.request({
|
||||
url: '/withdrawal/get',
|
||||
method: 'get',
|
||||
params,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取提现列表
|
||||
* 通过提现申请
|
||||
* @param {object} params
|
||||
* uuid 提现订单id
|
||||
* @returns {object} data
|
||||
*/
|
||||
export const solveWithdraw = (params) => {
|
||||
export const solveWithdraw = (data) => {
|
||||
return request.request({
|
||||
url: '/withdrawal/solve',
|
||||
method: 'get',
|
||||
params,
|
||||
url: 'withdrawal/update',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,6 +29,37 @@ export const addUser = (data) => {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改后台用户
|
||||
* @param {object} data
|
||||
* name 账号名称
|
||||
* password 密码
|
||||
* role 权限角色
|
||||
* @returns {array} data
|
||||
*/
|
||||
export const updateUser = (data) => {
|
||||
return request.request({
|
||||
url: '/user/update',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改后台用户状态
|
||||
* @param {object} data
|
||||
* name 账号名称
|
||||
* status 用户状态
|
||||
* @returns {array} data
|
||||
*/
|
||||
export const changeUserStatus = (data) => {
|
||||
return request.request({
|
||||
url: '/user/status',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除后台用户
|
||||
* @param {object} data
|
||||
|
|
@ -37,7 +68,7 @@ export const addUser = (data) => {
|
|||
*/
|
||||
export const deleteUser = (data) => {
|
||||
return request.request({
|
||||
url: '/user/get',
|
||||
url: '/user/delete',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 获取通知管理列表
|
||||
* @param {object} params
|
||||
* @returns {array} data
|
||||
*/
|
||||
export const getNoticeList = (params) => {
|
||||
return request.request({
|
||||
url: '/notice/get',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建通知
|
||||
* @param {object} params
|
||||
* @returns {array} data
|
||||
*/
|
||||
export const createNotice = (data) => {
|
||||
return request.request({
|
||||
url: '/notice/create',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 配置通知
|
||||
* @param {object} params
|
||||
* @returns {array} data
|
||||
*/
|
||||
export const updateNotice = (data) => {
|
||||
return request.request({
|
||||
url: '/notice/update',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 配置通知
|
||||
* @param {object} params
|
||||
* @returns {array} data
|
||||
*/
|
||||
export const deleteNotice = (data) => {
|
||||
return request.request({
|
||||
url: '/notice/delete',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
|
@ -5,12 +5,11 @@ export const fetchTableData = async (
|
|||
formatObj: any = {},
|
||||
) => {
|
||||
params.page = params.current;
|
||||
params.num = params.pageSize;
|
||||
params.page_size = params.pageSize;
|
||||
delete params.current;
|
||||
delete params.pageSize;
|
||||
const res = (await fetch(params)) || {};
|
||||
const data = res.data;
|
||||
|
||||
const data = res.items;
|
||||
data?.forEach((n: any) => {
|
||||
for (const key in formatObj) {
|
||||
n[key] = n[formatObj[key]];
|
||||
|
|
|
|||
Loading…
Reference in New Issue