mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-18 00:16:37 +08:00
修复令牌bug
This commit is contained in:
parent
9eb8ad6786
commit
e06186fe0c
@ -89,6 +89,7 @@ function App() {
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Layout.Content>
|
||||
<Routes>
|
||||
<Route
|
||||
path='/'
|
||||
@ -298,6 +299,7 @@ function App() {
|
||||
<NotFound />
|
||||
} />
|
||||
</Routes>
|
||||
</Layout.Content>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ const LogsTable = () => {
|
||||
isAdminUser ?
|
||||
record.type === 0 || record.type === 2 ?
|
||||
<div>
|
||||
{<Tag color={stringToColor(text)} size='large'> {text} </Tag>}
|
||||
{<Tag color={colors[parseInt(text) % colors.length]} size='large'> {text} </Tag>}
|
||||
</div>
|
||||
:
|
||||
<></>
|
||||
|
@ -187,21 +187,21 @@ const TokensTable = () => {
|
||||
|
||||
const closeEdit = () => {
|
||||
setShowEdit(false);
|
||||
setEditingToken({
|
||||
id: undefined,
|
||||
});
|
||||
// setEditingToken({
|
||||
// id: undefined,
|
||||
// });
|
||||
}
|
||||
|
||||
const setTokensFormat = (tokens) => {
|
||||
setTokens(tokens);
|
||||
if (tokens.length === ITEMS_PER_PAGE) {
|
||||
if (tokens.length >= ITEMS_PER_PAGE) {
|
||||
setTokenCount(tokens.length + ITEMS_PER_PAGE);
|
||||
} else {
|
||||
setTokenCount(tokens.length);
|
||||
}
|
||||
}
|
||||
|
||||
// let pageData = tokens.slice((activePage - 1) * ITEMS_PER_PAGE, activePage * ITEMS_PER_PAGE);
|
||||
let pageData = tokens.slice((activePage - 1) * ITEMS_PER_PAGE, activePage * ITEMS_PER_PAGE);
|
||||
const loadTokens = async (startIdx) => {
|
||||
setLoading(true);
|
||||
const res = await API.get(`/api/token/?p=${startIdx}`);
|
||||
@ -450,11 +450,12 @@ const TokensTable = () => {
|
||||
onClick={searchTokens} style={{marginRight: 8}}>查询</Button>
|
||||
</Form>
|
||||
|
||||
<Table style={{marginTop: 20}} columns={columns} dataSource={tokens} pagination={{
|
||||
<Table style={{marginTop: 20}} columns={columns} dataSource={pageData} pagination={{
|
||||
currentPage: activePage,
|
||||
pageSize: ITEMS_PER_PAGE,
|
||||
total: tokenCount,
|
||||
pageSizeOpts: [10, 20, 50, 100],
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: [10, 20, 50, 100],
|
||||
onPageChange: handlePageChange,
|
||||
}} loading={loading} rowSelection={rowSelection}>
|
||||
</Table>
|
||||
|
@ -8,6 +8,15 @@ body {
|
||||
scrollbar-width: none;
|
||||
color: var(--semi-color-text-0) !important;
|
||||
background-color: var( --semi-color-bg-0) !important;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#root {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.semi-layout {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tableShow {
|
||||
@ -40,7 +49,7 @@ code {
|
||||
/*display: flex;*/
|
||||
/*flex-direction: column;*/
|
||||
/*width: 100%;*/
|
||||
height: 100vh;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ root.render(
|
||||
<UserProvider>
|
||||
<BrowserRouter>
|
||||
<Layout>
|
||||
|
||||
<Sider>
|
||||
<SiderBar/>
|
||||
</Sider>
|
||||
@ -37,11 +36,12 @@ root.render(
|
||||
>
|
||||
<App/>
|
||||
</Content>
|
||||
<Footer></Footer>
|
||||
</Layout>
|
||||
{/*<Layout.Footer>*/}
|
||||
{/* <Footer></Footer>*/}
|
||||
{/*</Layout.Footer>*/}
|
||||
</Layout>
|
||||
<ToastContainer/>
|
||||
{/*<Footer />*/}
|
||||
</Layout>
|
||||
</BrowserRouter>
|
||||
</UserProvider>
|
||||
</StatusProvider>
|
||||
|
@ -112,6 +112,7 @@ const EditToken = (props) => {
|
||||
return (
|
||||
<>
|
||||
<SideSheet
|
||||
placement={isEdit ? 'right' : 'left'}
|
||||
title={<Title level={3}>{isEdit ? '更新令牌信息' : '创建新的令牌'}</Title>}
|
||||
headerStyle={{borderBottom: '1px solid var(--semi-color-border)'}}
|
||||
bodyStyle={{borderBottom: '1px solid var(--semi-color-border)'}}
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {Button, Confirm, Form, Grid, Header, Segment, Statistic} from 'semantic-ui-react';
|
||||
import {API, showError, showInfo, showSuccess} from '../../helpers';
|
||||
import {Button, Card, Confirm, Form, Grid, Header, Segment, Statistic} from 'semantic-ui-react';
|
||||
import {API, isMobile, showError, showInfo, showSuccess} from '../../helpers';
|
||||
import {renderNumber, renderQuota} from '../../helpers/render';
|
||||
import {Col, Layout, Row, Typography} from "@douyinfe/semi-ui";
|
||||
|
||||
const TopUp = () => {
|
||||
const [redemptionCode, setRedemptionCode] = useState('');
|
||||
@ -162,7 +163,15 @@ const TopUp = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Segment>
|
||||
<Layout>
|
||||
<Layout.Header>
|
||||
<h3>我的钱包</h3>
|
||||
</Layout.Header>
|
||||
<Layout.Content>
|
||||
<div style={{marginTop: 20, paddingLeft: isMobile()?0:200, paddingRight: isMobile()?0:200}}>
|
||||
<Card
|
||||
style={{width: '100%', padding: '20px'}}
|
||||
>
|
||||
<Confirm
|
||||
open={open}
|
||||
content={'充值数量:' + topUpCount + ',充值金额:' + renderAmount() + ',是否确认充值?'}
|
||||
@ -171,7 +180,7 @@ const TopUp = () => {
|
||||
onCancel={handleCancel}
|
||||
onConfirm={onlineTopUp}
|
||||
/>
|
||||
<Header as='h3'>充值额度</Header>
|
||||
<h3>兑换</h3>
|
||||
<Grid columns={2} stackable>
|
||||
<Grid.Column>
|
||||
<Form>
|
||||
@ -200,8 +209,10 @@ const TopUp = () => {
|
||||
</Statistic.Group>
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
</Segment>
|
||||
<Segment>
|
||||
</Card>
|
||||
<Card
|
||||
style={{width: '100%', padding: '20px'}}
|
||||
>
|
||||
<Header as='h3'>在线充值,最低1</Header>
|
||||
<Grid columns={2} stackable>
|
||||
<Grid.Column>
|
||||
@ -217,14 +228,6 @@ const TopUp = () => {
|
||||
await getAmount(e.target.value);
|
||||
}}
|
||||
/>
|
||||
{/*<Form.Input*/}
|
||||
{/* placeholder='充值码,如果你没有充值码,可不填写'*/}
|
||||
{/* name='redemptionCount'*/}
|
||||
{/* value={topUpCode}*/}
|
||||
{/* onChange={(e) => {*/}
|
||||
{/* setTopUpCode(e.target.value);*/}
|
||||
{/* }}*/}
|
||||
{/*/>*/}
|
||||
<Button color='blue' onClick={
|
||||
async () => {
|
||||
preTopUp('zfb')
|
||||
@ -250,7 +253,11 @@ const TopUp = () => {
|
||||
</Statistic.Group>
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
</Segment>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
</Layout.Content>
|
||||
</Layout>
|
||||
</div>
|
||||
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user