Style fix
This commit is contained in:
@@ -7,6 +7,7 @@ import React, { useEffect } from 'react';
|
|||||||
import { connect, DispatchProp } from 'dva';
|
import { connect, DispatchProp } from 'dva';
|
||||||
import { Spin, Input, Select, Icon, Button, message, Modal } from 'antd';
|
import { Spin, Input, Select, Icon, Button, message, Modal } from 'antd';
|
||||||
import { formatMessage } from 'umi-plugin-locale';
|
import { formatMessage } from 'umi-plugin-locale';
|
||||||
|
import _ from 'lodash';
|
||||||
import { DrawModelState } from './model';
|
import { DrawModelState } from './model';
|
||||||
import { PageState } from '@/types/common';
|
import { PageState } from '@/types/common';
|
||||||
import Header from '@/components/Header';
|
import Header from '@/components/Header';
|
||||||
@@ -99,7 +100,7 @@ const DrawPage: React.FC<DispatchProp & DrawModelState> = ({
|
|||||||
<Option
|
<Option
|
||||||
key={it.id}
|
key={it.id}
|
||||||
value={it.id}
|
value={it.id}
|
||||||
>{it.label.toUpperCase()}</Option>
|
>{(_.take(it.label, 4).join('')).toUpperCase()}</Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,20 +2,13 @@ import http from '@/utils/http';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import { CoinDrawn, FundBasic } from '@/types/common';
|
import { CoinDrawn, FundBasic } from '@/types/common';
|
||||||
import { loadDrawCoins, storeDrawCoins } from '@/utils/storage';
|
|
||||||
|
|
||||||
export async function getCoins(): Promise<CoinDrawn[]> {
|
export async function getCoins(): Promise<CoinDrawn[]> {
|
||||||
const coinsCached = loadDrawCoins();
|
|
||||||
if (coinsCached && coinsCached.length) {
|
|
||||||
return coinsCached;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { ok, msg, data } = await http.get<CoinDrawn[]>('/fund/withdrawCoins');
|
const { ok, msg, data } = await http.get<CoinDrawn[]>('/fund/withdrawCoins');
|
||||||
|
|
||||||
if (!ok || !data) {
|
if (!ok || !data) {
|
||||||
throw Error(msg);
|
throw Error(msg);
|
||||||
}
|
}
|
||||||
storeDrawCoins(data);
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { connect, DispatchProp } from 'dva';
|
import { connect, DispatchProp } from 'dva';
|
||||||
import { Spin, Input, Select, message } from 'antd';
|
import { Spin, Input, Select, message } from 'antd';
|
||||||
import { formatMessage } from 'umi-plugin-locale';
|
import { formatMessage } from 'umi-plugin-locale';
|
||||||
|
import _ from 'lodash';
|
||||||
import { QRCanvas } from 'qrcanvas-react';
|
import { QRCanvas } from 'qrcanvas-react';
|
||||||
import Clipboard from 'react-clipboard.js';
|
import Clipboard from 'react-clipboard.js';
|
||||||
import { MineModelState } from './model';
|
import { MineModelState } from './model';
|
||||||
@@ -56,7 +57,7 @@ const MinePage: React.FC<DispatchProp & MineModelState> = ({
|
|||||||
<Option
|
<Option
|
||||||
key={it.id}
|
key={it.id}
|
||||||
value={it.id}
|
value={it.id}
|
||||||
>{it.label.toUpperCase()}</Option>
|
>{(_.take(it.label, 4).join('')).toUpperCase()}</Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import { CoinUnion, CoinSupport, CoinAddress } from '@/types/common';
|
|||||||
import { loadCoins, storeCoins } from '@/utils/storage';
|
import { loadCoins, storeCoins } from '@/utils/storage';
|
||||||
|
|
||||||
export async function getCoins(): Promise<CoinUnion[]> {
|
export async function getCoins(): Promise<CoinUnion[]> {
|
||||||
const coinsCached = loadCoins();
|
// const coinsCached = loadCoins();
|
||||||
if (coinsCached && coinsCached.length) {
|
// if (coinsCached && coinsCached.length) {
|
||||||
return coinsCached;
|
// return coinsCached;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const [
|
const [
|
||||||
{ ok: sOk, data: sData, msg: sMsg },
|
{ ok: sOk, data: sData, msg: sMsg },
|
||||||
@@ -30,7 +30,7 @@ export async function getCoins(): Promise<CoinUnion[]> {
|
|||||||
it,
|
it,
|
||||||
_.find(aData, ['id', it.id]),
|
_.find(aData, ['id', it.id]),
|
||||||
));
|
));
|
||||||
storeCoins(result);
|
// storeCoins(result);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user