Browse Source

commit

main
mac 5 months ago
parent
commit
5df29d98c1
  1. BIN
      .DS_Store
  2. 5
      .env
  3. 1
      env
  4. 9
      env-temp
  5. 124
      package-lock.json
  6. 3
      package.json
  7. 5
      src/api/index.ts
  8. 1
      src/pages/manage/deposit.tsx
  9. 5
      src/pages/review/deposit.tsx
  10. 29
      src/pages/system-log/operationLog.tsx
  11. 19
      src/pages/system/notify.tsx
  12. 66
      src/pages/vip-manage/proxy-list.tsx
  13. 1
      src/route/routes.ts
  14. 5
      src/utils/axios.ts

BIN
.DS_Store

5
.env

@ -1,2 +1,3 @@
REACT_APP_BASE_URL=http://162.254.37.253:8082/api/v1
SKIP_PREFLIGHT_CHECK=true
SKIP_PREFLIGHT_CHECK=true
REACT_APP_BASE_URL=https://matontrading.com
REACT_APP_ORIGIN_URL=https://matontrading.com

1
env

@ -1 +0,0 @@
REACT_APP_BASE_URL=http://14.29.101.215:30303/api/v1

9
env-temp

@ -0,0 +1,9 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_BASE_URL=https://matontrading.com
REACT_APP_ORIGIN_URL=https://matontrading.com
# Prod
SKIP_PREFLIGHT_CHECK=true
REACT_APP_BASE_URL=http://203.161.61.234:8082
REACT_APP_ORIGIN_URL=http://162.254.37.253:8086

124
package-lock.json

@ -36,6 +36,7 @@
"react-canvas-nest": "^1.0.10",
"react-dom": "^16.13.1",
"react-flow-renderer": "^10.3.17",
"react-quill": "^2.0.0",
"react-redux": "^7.1.3",
"react-router-breadcrumbs-hoc": "^3.2.4",
"react-router-dom": "^5.1.2",
@ -3889,6 +3890,14 @@
"resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.8.tgz",
"integrity": "sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw=="
},
"node_modules/@types/quill": {
"version": "1.3.10",
"resolved": "https://registry.npmjs.org/@types/quill/-/quill-1.3.10.tgz",
"integrity": "sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==",
"dependencies": {
"parchment": "^1.1.2"
}
},
"node_modules/@types/react": {
"version": "16.14.60",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.60.tgz",
@ -17303,6 +17312,11 @@
"no-case": "^2.2.0"
}
},
"node_modules/parchment": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@ -19031,6 +19045,42 @@
}
]
},
"node_modules/quill": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz",
"integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
"dependencies": {
"clone": "^2.1.1",
"deep-equal": "^1.0.1",
"eventemitter3": "^2.0.3",
"extend": "^3.0.2",
"parchment": "^1.1.4",
"quill-delta": "^3.6.2"
}
},
"node_modules/quill-delta": {
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz",
"integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
"dependencies": {
"deep-equal": "^1.0.1",
"extend": "^3.0.2",
"fast-diff": "1.1.2"
},
"engines": {
"node": ">=0.10"
}
},
"node_modules/quill-delta/node_modules/fast-diff": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz",
"integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="
},
"node_modules/quill/node_modules/eventemitter3": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
"integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="
},
"node_modules/raf": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
@ -20499,6 +20549,20 @@
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
},
"node_modules/react-quill": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/react-quill/-/react-quill-2.0.0.tgz",
"integrity": "sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg==",
"dependencies": {
"@types/quill": "^1.3.10",
"lodash": "^4.17.4",
"quill": "^1.3.7"
},
"peerDependencies": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18"
}
},
"node_modules/react-redux": {
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.9.tgz",
@ -29884,6 +29948,14 @@
"resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.8.tgz",
"integrity": "sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw=="
},
"@types/quill": {
"version": "1.3.10",
"resolved": "https://registry.npmjs.org/@types/quill/-/quill-1.3.10.tgz",
"integrity": "sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==",
"requires": {
"parchment": "^1.1.2"
}
},
"@types/react": {
"version": "16.14.60",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.60.tgz",
@ -40441,6 +40513,11 @@
"no-case": "^2.2.0"
}
},
"parchment": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="
},
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@ -41797,6 +41874,43 @@
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"dev": true
},
"quill": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz",
"integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
"requires": {
"clone": "^2.1.1",
"deep-equal": "^1.0.1",
"eventemitter3": "^2.0.3",
"extend": "^3.0.2",
"parchment": "^1.1.4",
"quill-delta": "^3.6.2"
},
"dependencies": {
"eventemitter3": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
"integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="
}
}
},
"quill-delta": {
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz",
"integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
"requires": {
"deep-equal": "^1.0.1",
"extend": "^3.0.2",
"fast-diff": "1.1.2"
},
"dependencies": {
"fast-diff": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz",
"integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="
}
}
},
"raf": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
@ -43026,6 +43140,16 @@
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
},
"react-quill": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/react-quill/-/react-quill-2.0.0.tgz",
"integrity": "sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg==",
"requires": {
"@types/quill": "^1.3.10",
"lodash": "^4.17.4",
"quill": "^1.3.7"
}
},
"react-redux": {
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.9.tgz",

3
package.json

@ -31,6 +31,7 @@
"react-canvas-nest": "^1.0.10",
"react-dom": "^16.13.1",
"react-flow-renderer": "^10.3.17",
"react-quill": "^2.0.0",
"react-redux": "^7.1.3",
"react-router-breadcrumbs-hoc": "^3.2.4",
"react-router-dom": "^5.1.2",
@ -44,7 +45,7 @@
"start": "cross-env PORT=3000 react-app-rewired start",
"test": "react-app-rewired test",
"build": "react-app-rewired build",
"deploy": "npm run build && scp -r ./build/* dcfilefast_prod:/data/wwwroot/tarder-admin",
"deploy:dev": "npm run build && scp -r ./build/* dcfilefast_prod:/data/wwwroot/tarder-admin",
"deploy:prod": "npm run build && scp -r ./build/* metatrader_prod:/data/wwwroot/admin-matontrading.com"
},
"eslintConfig": {

5
src/api/index.ts

@ -147,7 +147,7 @@ export default {
return $axios.post('/admin/emailRecords', data)
},
get_operationRecord(data: object) {
return $axios.post('/admin/emailRecords', data)
return $axios.post('/admin/operationLog', data)
},
get_walletRecord(data: object) {
return $axios.post('/admin/walletDetails', data)
@ -161,5 +161,8 @@ export default {
verify_googleCode(data: object) {
return $axios.post('/admin/verifyAuthenticator', data)
},
copy_tradeapi(data: object) {
return $axios.post('/admin/copytradeapi', data)
},
}

1
src/pages/manage/deposit.tsx

@ -8,6 +8,7 @@ const DepositManage = () => {
const columns = [
{ "dataIndex": "account", "title": "MT账户", width: 200 },
{ "dataIndex": "deposit_method", "title": "存款方式", width: 240 },
{ "dataIndex": "amount", "title": "存款金额", width: 200 },
{
"dataIndex": "time", "title": "时间", render: (time) => (
<div>{getTime(time * 1000)}</div>

5
src/pages/review/deposit.tsx

@ -34,6 +34,11 @@ const DepositReview = () => {
dataIndex: 'status',
width: 150,
},
{
title: '存款金额',
dataIndex: 'amount',
width: 150,
},
{
title: '存款方式',
dataIndex: 'deposit_method',

29
src/pages/system-log/operationLog.tsx

@ -6,39 +6,24 @@ const OperationLog = () => {
const columns = [
{
title: '接受帐号',
dataIndex: 'account',
width: 260
},
{
title: '详细',
dataIndex: 'detail',
dataIndex: 'id',
title: 'id',
width: 200
},
{
title: 'ID',
dataIndex: 'id',
width: 200
dataIndex: 'operator',
title: '操作人',
width: 260
},
{
title: '状态',
dataIndex: 'status',
dataIndex: 'operator_type',
title: '操作类型',
width: 200
},
{
title: '时间',
dataIndex: 'time',
render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式
width: 200
},
{
title: '标题',
dataIndex: 'title',
width: 200
},
{
title: '类型',
dataIndex: 'type',
},
];

19
src/pages/system/notify.tsx

@ -3,7 +3,10 @@ import MyTable from "@/components/MyTable"
import { getTime } from "@/utils"
import { DeleteFilled, EditOutlined } from "@ant-design/icons"
import { Button, Form, Input, Modal, Popconfirm, Switch, Tooltip, notification } from "antd"
import TextArea from "antd/lib/input/TextArea"
import React, { useEffect, useRef, useState } from "react"
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css';
const SystemNofify = () => {
@ -12,6 +15,7 @@ const SystemNofify = () => {
const [form] = Form.useForm()
const currentType = useRef('')
const currentItem = useRef({} as any)
const [value, setValue] = useState('');
const columns = [
{
@ -37,8 +41,8 @@ const SystemNofify = () => {
},
{
"dataIndex": "content", "title": "内容", width: 340, render: (text) => (
<Tooltip title={text}>
<div style={{ maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{text}</div>
<Tooltip title={<div dangerouslySetInnerHTML={{ __html: text }} />}>
<div style={{ maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', height: 60 }} dangerouslySetInnerHTML={{ __html: text }}></div>
</Tooltip>
)
},
@ -119,18 +123,19 @@ const SystemNofify = () => {
setVisibleModal(false)
}}
footer={() => null}
width="50%"
>
<Form form={form} onFinish={onFinish}>
<Form.Item label="标题" name="title" rules={[{ required: true, message: '请输入标题' }]}>
<Input placeholder="请输入标题" />
</Form.Item>
<Form.Item label="内容" name="content" rules={[{ required: true, message: '请输入内容' }]}>
<Input placeholder="请输入内容" />
<TextArea placeholder="请输入标题" />
</Form.Item>
<Form.Item label="状态" name="status_code" valuePropName="checked" initialValue={true}>
<Switch />
</Form.Item>
<Form.Item style={{ display: 'flex' }}>
<Form.Item label="内容" style={{ height: 200 }} name="content" rules={[{ required: true, message: '请输入内容' }]}>
<ReactQuill theme="snow" value={value} style={{ height: 200 }} />
</Form.Item>
<Form.Item style={{ display: 'flex', marginTop: 70 }}>
<Button onClick={() => setVisibleModal(false)}></Button>
<Button style={{ marginLeft: 20 }} type="primary" htmlType="submit"></Button>
</Form.Item>

66
src/pages/vip-manage/proxy-list.tsx

@ -1,16 +1,19 @@
import React, { useEffect, useRef, useState } from "react";
import api from "@/api";
import MyTable from "@/components/MyTable";
import { DeleteFilled, EditOutlined, RightCircleFilled } from "@ant-design/icons";
import { DeleteFilled, EditOutlined, RightCircleFilled, SolutionOutlined } from "@ant-design/icons";
import { Button, Form, Input, Modal, Popconfirm, Radio, Select, Switch, notification } from "antd";
import { getOriginUrl } from "@/utils/axios";
import { getBaseUrl, getOriginUrl } from "@/utils/axios";
const ProxyList = () => {
const [modal, setModal] = useState(false);
const [modalFollow, setModalFollow] = useState(false);
const [visible, setVisible] = useState(false);
const [path, setPath] = useState('wallet');
const currentAccount = useRef({} as any);
const [form] = Form.useForm();
const [formAccount] = Form.useForm();
const [formFollow] = Form.useForm();
const tableRef = useRef(null);
const options = [
@ -26,17 +29,14 @@ const ProxyList = () => {
];
const getToken = async (item) => {
const url = getOriginUrl();
const targetWindow = window.open(url, '_blank');
const res: any = await api.get_userToken({ id: item.id });
if (res.code === 0) {
for (let i = 0; i < 5; i++) {
setTimeout(() => {
targetWindow.postMessage({ token: res.data.token }, url);
}, i * 1000);
}
}
const _token = res.data.token
window.localStorage.setItem('Tarder_Token', _token)
setTimeout(() => {
const url = getOriginUrl()
window.open(url, '_blank');
}, 1000)
};
const deleteAccount = async (item) => {
@ -69,7 +69,7 @@ const ProxyList = () => {
wallet: {
onFinish: (values) => onFinish(values, api.set_userWalletBalance, '修改成功'),
items: [
{ label: "当前余额", name: "balance", initialValue: currentAccount.current.balance, disabled: true },
{ label: "当前余额", component: <Input value={currentAccount.current.balance || ''} disabled /> },
{ label: "加减金额", name: "balance", rules: [{ required: true, message: '请输入加减金额' }] },
{ label: "邮箱通知", name: "email_flag", initialValue: true, valuePropName: "checked", component: <Switch /> }
]
@ -119,7 +119,7 @@ const ProxyList = () => {
const onFinishAddAccount = async (values) => {
const res: any = await api.add_account({ ...values });
if (res.code === 0) {
form.resetFields();
formAccount.resetFields();
setVisible(false);
tableRef.current.update();
notification.success({
@ -131,6 +131,21 @@ const ProxyList = () => {
}
};
const onFinishFollow = async (values) => {
setModalFollow(false)
const res: any = await api.copy_tradeapi({
...values,
id: currentAccount.current.id
})
if (res.code === 0) {
formFollow.resetFields()
notification.success({
message: '跟单设置成功'
})
tableRef.current.update();
}
}
const columns = [
{
title: '操作',
@ -144,6 +159,10 @@ const ProxyList = () => {
<RightCircleFilled style={{ margin: '0 10px' }} onClick={() => {
getToken(row);
}} />
<SolutionOutlined onClick={() => {
currentAccount.current = row
setModalFollow(true)
}} />
{/* <Popconfirm title={` "${row.name}" `} onConfirm={() => deleteAccount(row)}>
<DeleteFilled />
</Popconfirm> */}
@ -208,7 +227,7 @@ const ProxyList = () => {
bodyStyle={{ padding: "20px" }}
footer={() => null}
>
<Form form={form} onFinish={onFinishAddAccount}>
<Form form={formAccount} onFinish={onFinishAddAccount}>
<Form.Item label="名字" name="name" rules={[{ required: true, message: '请输入用户名称' }]}>
<Input placeholder="请输入用户名称" />
</Form.Item>
@ -227,6 +246,25 @@ const ProxyList = () => {
</div>
</Form>
</Modal>
<Modal
visible={modalFollow}
onCancel={() => setModalFollow(false)}
width="50%"
title={`跟单设置: ${currentAccount.current.name}`}
bodyStyle={{ padding: "20px" }}
footer={() => null}
>
<Form form={formFollow} onFinish={onFinishFollow}>
<Form.Item label="跟单账号" name="follower" rules={[{ required: true, message: '请输入跟单账号' }]}>
<Input placeholder="请输入跟单账号" />
</Form.Item>
<Form.Item label="操作">
<Button onClick={() => setModalFollow(false)}></Button>
<Button type="primary" htmlType="submit" style={{ marginLeft: 20 }}></Button>
</Form.Item>
</Form>
</Modal>
</div>
);
};

1
src/route/routes.ts

@ -111,7 +111,6 @@ const routes = [
name: '代理树',
exact: true,
key: 'chart',
icon: SolutionOutlined,
component: InviteChart,
routes: []
},

5
src/utils/axios.ts

@ -12,12 +12,11 @@ interface AxiosConfig {
}
export const getBaseUrl = () => {
// return `http://203.161.61.234:8082/api/v1`
return `https://matontrading.com/api/v1`
return `${process.env.REACT_APP_BASE_URL}/api/v1`
}
export const getOriginUrl = () => {
return `https://matontrading.com`
return process.env.REACT_APP_ORIGIN_URL
}
const config: AxiosConfig = {

Loading…
Cancel
Save