解决card组件废弃属性
This commit is contained in:
@@ -245,7 +245,7 @@ const AuthorizationPage: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ minHeight: '94vh' }}>
|
<div style={{ minHeight: '94vh' }}>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<LockOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<LockOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -35,10 +35,11 @@ const ConsumePage: React.FC = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadColumns();
|
loadColumns();
|
||||||
loadData();
|
loadData();
|
||||||
}, [page, pageSize]);
|
}, [page, pageSize, consumeDateRange]);
|
||||||
|
|
||||||
const loadData = async () => {
|
const loadData = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
console.log(consumeDateRange);
|
||||||
try {
|
try {
|
||||||
const res = await getMaterialConsumpList({
|
const res = await getMaterialConsumpList({
|
||||||
advertiser_id: advertiserId || undefined,
|
advertiser_id: advertiserId || undefined,
|
||||||
@@ -47,7 +48,6 @@ const ConsumePage: React.FC = () => {
|
|||||||
page,
|
page,
|
||||||
page_size: pageSize,
|
page_size: pageSize,
|
||||||
});
|
});
|
||||||
console.log(res);
|
|
||||||
setConsumptionRecords(res.data || []);
|
setConsumptionRecords(res.data || []);
|
||||||
setTotal(res.pagination?.total || 0);
|
setTotal(res.pagination?.total || 0);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
@@ -115,8 +115,8 @@ const ConsumePage: React.FC = () => {
|
|||||||
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<Button type="text" icon={<ArrowLeftOutlined />} onClick={handleBack} />
|
{/*<Button type="text" icon={<ArrowLeftOutlined />} onClick={handleBack} />
|
||||||
{/* <Button icon={<ArrowLeftOutlined />} onClick={handleBack}>返回</Button> */}
|
<Button icon={<ArrowLeftOutlined />} onClick={handleBack}>返回</Button> */}
|
||||||
<DollarOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<DollarOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
<Typography.Text strong style={{ fontSize: 16 }}>消耗记录</Typography.Text>
|
<Typography.Text strong style={{ fontSize: 16 }}>消耗记录</Typography.Text>
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ const AdminCreditRatios: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
|
||||||
{/* Text Credit Rate */}
|
{/* Text Credit Rate */}
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<FontSizeOutlined style={{ fontSize: 18, color: '#f59e0b' }} />
|
<FontSizeOutlined style={{ fontSize: 18, color: '#f59e0b' }} />
|
||||||
@@ -258,16 +258,18 @@ const AdminCreditRatios: React.FC = () => {
|
|||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
||||||
<Typography.Text>每1000 token消耗积分:</Typography.Text>
|
<Typography.Text>每1000 token消耗积分:</Typography.Text>
|
||||||
<InputNumber
|
<Space.Compact style={{ width: 160 }}>
|
||||||
min={0}
|
<InputNumber
|
||||||
max={1000}
|
min={0}
|
||||||
step={0.01}
|
max={1000}
|
||||||
value={textRate}
|
step={0.01}
|
||||||
onChange={(v) => setTextRate(v || 0)}
|
value={textRate}
|
||||||
size="large"
|
onChange={(v) => setTextRate(v || 0)}
|
||||||
style={{ width: 160 }}
|
size="large"
|
||||||
addonAfter="积分"
|
style={{ width: '100%' }}
|
||||||
/>
|
/>
|
||||||
|
<Typography.Text>积分</Typography.Text>
|
||||||
|
</Space.Compact>
|
||||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||||
示例:1000 token = {textRate} 积分,500 token = {(500 * textRate / 1000).toFixed(4)} 积分
|
示例:1000 token = {textRate} 积分,500 token = {(500 * textRate / 1000).toFixed(4)} 积分
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
@@ -275,7 +277,7 @@ const AdminCreditRatios: React.FC = () => {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Generation Credit Ratios */}
|
{/* Generation Credit Ratios */}
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<CalculatorOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<CalculatorOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ const AdminCreditRecords: React.FC = () => {
|
|||||||
<div>
|
<div>
|
||||||
{/* Summary Cards */}
|
{/* Summary Cards */}
|
||||||
<div style={{ display: 'flex', gap: 16, marginBottom: 16 }}>
|
<div style={{ display: 'flex', gap: 16, marginBottom: 16 }}>
|
||||||
<Card bordered={false} style={{ flex: 1, borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ flex: 1, borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 44, height: 44, borderRadius: 10,
|
width: 44, height: 44, borderRadius: 10,
|
||||||
@@ -133,7 +133,7 @@ const AdminCreditRecords: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<Card bordered={false} style={{ flex: 1, borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ flex: 1, borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 44, height: 44, borderRadius: 10,
|
width: 44, height: 44, borderRadius: 10,
|
||||||
@@ -147,7 +147,7 @@ const AdminCreditRecords: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<Card bordered={false} style={{ flex: 1, borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ flex: 1, borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 44, height: 44, borderRadius: 10,
|
width: 44, height: 44, borderRadius: 10,
|
||||||
@@ -163,7 +163,7 @@ const AdminCreditRecords: React.FC = () => {
|
|||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<Select
|
<Select
|
||||||
|
|||||||
@@ -764,7 +764,7 @@ const AdminGenerationAiRecords: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<PlayCircleOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<PlayCircleOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -867,7 +867,7 @@ const AdminGenerationRecords: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<VideoCameraOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<VideoCameraOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ const AdminLoginPage = () => {
|
|||||||
bottom: -100, left: -80, filter: 'blur(50px)',
|
bottom: -100, left: -80, filter: 'blur(50px)',
|
||||||
}} />
|
}} />
|
||||||
|
|
||||||
<Card bordered={false} style={{
|
<Card variant="outlined" style={{
|
||||||
width: 440,
|
width: 440,
|
||||||
borderRadius: 20,
|
borderRadius: 20,
|
||||||
boxShadow: '0 20px 60px rgba(0,0,0,0.08)',
|
boxShadow: '0 20px 60px rgba(0,0,0,0.08)',
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ const AdminMenuConfig: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<MenuOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<MenuOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ const AdminModels: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Typography.Text type="secondary">
|
<Typography.Text type="secondary">
|
||||||
共 {models.length} 个模型配置,按权重进行加权随机调度
|
共 {models.length} 个模型配置,按权重进行加权随机调度
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ const AdminNotificationManager: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<BellOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<BellOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const AdminOperationLogs: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<HistoryOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<HistoryOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
Button, Card, Form, Input, message, Switch, Typography, InputNumber,
|
Button, Card, Form, Input, message, Switch, Typography, InputNumber, Space,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import {
|
import {
|
||||||
SaveOutlined, WechatOutlined, AlipayCircleOutlined, DollarOutlined, ClockCircleOutlined,
|
SaveOutlined, WechatOutlined, AlipayCircleOutlined, DollarOutlined, ClockCircleOutlined,
|
||||||
@@ -85,7 +85,7 @@ const AdminPaymentConfig: React.FC = () => {
|
|||||||
<div style={{ display: 'flex', gap: 24, flexWrap: 'wrap', marginBottom: 24 }}>
|
<div style={{ display: 'flex', gap: 24, flexWrap: 'wrap', marginBottom: 24 }}>
|
||||||
{/* 通用设置:订单超时时间 */}
|
{/* 通用设置:订单超时时间 */}
|
||||||
<div style={{ flex: '1 1 400px', minWidth: 400 }}>
|
<div style={{ flex: '1 1 400px', minWidth: 400 }}>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
@@ -100,14 +100,16 @@ const AdminPaymentConfig: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
<Form form={form} layout="inline">
|
<Form form={form} layout="inline">
|
||||||
<Form.Item name="order_timeout" style={{ margin: 0 }}>
|
<Form.Item name="order_timeout" style={{ margin: 0 }}>
|
||||||
<InputNumber
|
<Space.Compact style={{ width: 140 }}>
|
||||||
min={30}
|
<InputNumber
|
||||||
max={86400}
|
min={30}
|
||||||
placeholder="180"
|
max={86400}
|
||||||
style={{ width: 140 }}
|
placeholder="180"
|
||||||
size="middle"
|
style={{ width: '100%' }}
|
||||||
addonAfter="秒"
|
size="middle"
|
||||||
/>
|
/>
|
||||||
|
<Typography.Text>秒</Typography.Text>
|
||||||
|
</Space.Compact>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
@@ -116,7 +118,7 @@ const AdminPaymentConfig: React.FC = () => {
|
|||||||
|
|
||||||
{/* 模拟支付模式 */}
|
{/* 模拟支付模式 */}
|
||||||
<div style={{ flex: '1 1 400px', minWidth: 400 }}>
|
<div style={{ flex: '1 1 400px', minWidth: 400 }}>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5', background: mockMode ? '#fff7e6' : '#fafbff' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5', background: mockMode ? '#fff7e6' : '#fafbff' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
@@ -139,7 +141,7 @@ const AdminPaymentConfig: React.FC = () => {
|
|||||||
<div style={{ display: 'flex', gap: 24, flexWrap: 'wrap' }}>
|
<div style={{ display: 'flex', gap: 24, flexWrap: 'wrap' }}>
|
||||||
{/* 微信支付 */}
|
{/* 微信支付 */}
|
||||||
<div style={{ flex: '1 1 400px', minWidth: 400 }}>
|
<div style={{ flex: '1 1 400px', minWidth: 400 }}>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 20 }}>
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 20 }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
@@ -216,7 +218,7 @@ const AdminPaymentConfig: React.FC = () => {
|
|||||||
|
|
||||||
{/* 支付宝 */}
|
{/* 支付宝 */}
|
||||||
<div style={{ flex: '1 1 400px', minWidth: 400 }}>
|
<div style={{ flex: '1 1 400px', minWidth: 400 }}>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 20 }}>
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 20 }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ const AdminPaymentStats: React.FC = () => {
|
|||||||
{/* Summary cards */}
|
{/* Summary cards */}
|
||||||
<Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
|
<Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
|
||||||
<Col xs={24} sm={12} lg={12}>
|
<Col xs={24} sm={12} lg={12}>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title="今日收入"
|
title="今日收入"
|
||||||
value={stats.today.paidAmount}
|
value={stats.today.paidAmount}
|
||||||
@@ -186,7 +186,7 @@ const AdminPaymentStats: React.FC = () => {
|
|||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={24} sm={12} lg={12}>
|
<Col xs={24} sm={12} lg={12}>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title="本月累计"
|
title="本月累计"
|
||||||
value={monthInfo.paidAmount}
|
value={monthInfo.paidAmount}
|
||||||
@@ -203,7 +203,7 @@ const AdminPaymentStats: React.FC = () => {
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{/* Status breakdown */}
|
{/* Status breakdown */}
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5', marginBottom: 16 }}
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5', marginBottom: 16 }}
|
||||||
title={<Space><DollarOutlined />订单状态分布</Space>}>
|
title={<Space><DollarOutlined />订单状态分布</Space>}>
|
||||||
<Row gutter={16}>
|
<Row gutter={16}>
|
||||||
{['paid', 'pending', 'cancelled', 'refunded'].map(s => {
|
{['paid', 'pending', 'cancelled', 'refunded'].map(s => {
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ const AdminRechargePackages: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<GiftOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<GiftOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -237,12 +237,12 @@ const AdminSettings: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <Card loading bordered={false} style={{ borderRadius: 12 }} />;
|
return <Card loading variant="outlined" style={{ borderRadius: 12 }} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ maxWidth: 720 }}>
|
<div style={{ maxWidth: 720 }}>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5', marginBottom: 16 }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5', marginBottom: 16 }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 24 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 24 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 44, height: 44, borderRadius: 10,
|
width: 44, height: 44, borderRadius: 10,
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ const AdminUsers: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5', marginBottom: 16 }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5', marginBottom: 16 }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 20 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 20 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 44, height: 44, borderRadius: 10,
|
width: 44, height: 44, borderRadius: 10,
|
||||||
@@ -316,7 +316,7 @@ const AdminUsers: React.FC = () => {
|
|||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
{/* Search bar */}
|
{/* Search bar */}
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<div style={{ display: 'flex', gap: 12 }}>
|
<div style={{ display: 'flex', gap: 12 }}>
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ const AdminVideoEngines: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card bordered={false} style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
<Card variant="outlined" style={{ borderRadius: 12, border: '1px solid #f0f0f5' }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 16 }}>
|
||||||
<Space>
|
<Space>
|
||||||
<PlayCircleOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
<PlayCircleOutlined style={{ fontSize: 18, color: '#6366f1' }} />
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ node_modules
|
|||||||
dist-ssr
|
dist-ssr
|
||||||
*.local
|
*.local
|
||||||
|
|
||||||
|
# Environment files
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
|
|||||||
+111
-111
File diff suppressed because one or more lines are too long
Vendored
+36
-36
@@ -1,37 +1,37 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
|
||||||
<title>民众智创</title>
|
<title>民众智创</title>
|
||||||
<script>
|
<script>
|
||||||
(function() {
|
(function() {
|
||||||
var cached = localStorage.getItem('siteInfo');
|
var cached = localStorage.getItem('siteInfo');
|
||||||
if (cached) {
|
if (cached) {
|
||||||
try {
|
try {
|
||||||
var info = JSON.parse(cached);
|
var info = JSON.parse(cached);
|
||||||
if (info.siteName) {
|
if (info.siteName) {
|
||||||
document.title = info.siteName;
|
document.title = info.siteName;
|
||||||
}
|
}
|
||||||
if (info.siteLogo) {
|
if (info.siteLogo) {
|
||||||
var link = document.querySelector('link[rel="icon"]');
|
var link = document.querySelector('link[rel="icon"]');
|
||||||
if (link) {
|
if (link) {
|
||||||
link.href = info.siteLogo;
|
link.href = info.siteLogo;
|
||||||
link.type = 'image/png';
|
link.type = 'image/png';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/index-BjRp0K8U.js"></script>
|
<script type="module" crossorigin src="/assets/index-DLfJXBov.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-eLRg4pQk.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-eLRg4pQk.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>␍
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import RemoveInfo from './pages/RemoveInfo';
|
|||||||
import RemoveRw from './pages/RemoveRw';
|
import RemoveRw from './pages/RemoveRw';
|
||||||
// import RemoveFenbu from './pages/RemoveFenbu';
|
// import RemoveFenbu from './pages/RemoveFenbu';
|
||||||
import ConsumePage from './pages/ConsumePage';
|
import ConsumePage from './pages/ConsumePage';
|
||||||
|
import AuthorizationWaitingPage from './pages/AuthorizationWaitingPage';
|
||||||
import { useAuthStore } from './store/useAuthStore';
|
import { useAuthStore } from './store/useAuthStore';
|
||||||
const ProtectedRoute = ({ children }: { children: React.ReactNode }) => {
|
const ProtectedRoute = ({ children }: { children: React.ReactNode }) => {
|
||||||
const { user, loading, checkAuth } = useAuthStore();
|
const { user, loading, checkAuth } = useAuthStore();
|
||||||
@@ -109,6 +110,7 @@ const App = () => {
|
|||||||
<Route path="generated" element={<GeneratedRecord />} />
|
<Route path="generated" element={<GeneratedRecord />} />
|
||||||
<Route path="pretest" element={<PreTest />} />
|
<Route path="pretest" element={<PreTest />} />
|
||||||
<Route path="authorization" element={<AuthorizationPage />} />
|
<Route path="authorization" element={<AuthorizationPage />} />
|
||||||
|
<Route path="authoriza-waiting" element={<AuthorizationWaitingPage />} />
|
||||||
<Route path="materials" element={<MaterialListPage />} />
|
<Route path="materials" element={<MaterialListPage />} />
|
||||||
<Route path="consume" element={<ConsumePage />} />
|
<Route path="consume" element={<ConsumePage />} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|||||||
@@ -414,11 +414,19 @@ export async function requestOAuth(params: RequestOAuthParams): Promise<any> {
|
|||||||
export interface JuliangCallbackParams {
|
export interface JuliangCallbackParams {
|
||||||
auth_code: string;
|
auth_code: string;
|
||||||
state: string;
|
state: string;
|
||||||
|
app_id?: string;
|
||||||
|
material_auth_status?: string;
|
||||||
|
scope?: string;
|
||||||
|
uid?: string;
|
||||||
}
|
}
|
||||||
export async function juliang_callback(params: JuliangCallbackParams): Promise<any> {
|
export async function juliang_callback(params: JuliangCallbackParams): Promise<any> {
|
||||||
const query = new URLSearchParams();
|
const query = new URLSearchParams();
|
||||||
query.set('auth_code', params.auth_code);
|
query.set('auth_code', params.auth_code);
|
||||||
query.set('state', params.state);
|
query.set('state', params.state);
|
||||||
|
if (params.app_id) query.set('app_id', params.app_id);
|
||||||
|
if (params.material_auth_status) query.set('material_auth_status', params.material_auth_status);
|
||||||
|
if (params.scope) query.set('scope', params.scope);
|
||||||
|
if (params.uid) query.set('uid', params.uid);
|
||||||
return api.get(`/user-oauth/juliang_callback?${query.toString()}`);
|
return api.get(`/user-oauth/juliang_callback?${query.toString()}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,153 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { Typography, Spin, Button, App } from 'antd';
|
||||||
|
import { ClockCircleOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||||
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
|
import { juliang_callback, getOAuthList } from '../api';
|
||||||
|
|
||||||
|
const AuthorizationWaitingPage: React.FC = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const [searchParams] = useSearchParams();
|
||||||
|
const { message } = App.useApp();
|
||||||
|
const [countdown, setCountdown] = useState(0);
|
||||||
|
const [isChecking, setIsChecking] = useState(true);
|
||||||
|
const [authSuccess, setAuthSuccess] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const authCode = searchParams.get('auth_code');
|
||||||
|
const state = searchParams.get('state');
|
||||||
|
|
||||||
|
if (!authCode || !state) {
|
||||||
|
setIsChecking(false);
|
||||||
|
setCountdown(10);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
auth_code: authCode,
|
||||||
|
state: state,
|
||||||
|
app_id: searchParams.get('app_id') || undefined,
|
||||||
|
material_auth_status: searchParams.get('material_auth_status') || undefined,
|
||||||
|
scope: searchParams.get('scope') || undefined,
|
||||||
|
uid: searchParams.get('uid') || undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCallback = async () => {
|
||||||
|
try {
|
||||||
|
await juliang_callback(params);
|
||||||
|
setAuthSuccess(true);
|
||||||
|
setIsChecking(false);
|
||||||
|
message.success('授权成功');
|
||||||
|
setTimeout(() => {
|
||||||
|
navigate('/authorization');
|
||||||
|
}, 1500);
|
||||||
|
} catch (error) {
|
||||||
|
console.log('授权回调失败,开始轮询检查...');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleCallback();
|
||||||
|
|
||||||
|
const checkInterval = setInterval(async () => {
|
||||||
|
try {
|
||||||
|
// await getOAuthList({ page: 1, page_size: 1 });
|
||||||
|
// setAuthSuccess(true);
|
||||||
|
// setIsChecking(false);
|
||||||
|
// message.success('授权成功');
|
||||||
|
// clearInterval(checkInterval);
|
||||||
|
// setTimeout(() => {
|
||||||
|
// navigate('/authorization');
|
||||||
|
// }, 1500);
|
||||||
|
} catch (error) {
|
||||||
|
console.log('授权检查中...');
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
setCountdown(prev => {
|
||||||
|
if (prev >= 11) {
|
||||||
|
clearInterval(checkInterval);
|
||||||
|
setIsChecking(false);
|
||||||
|
return prev;
|
||||||
|
}
|
||||||
|
return prev + 1;
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
clearInterval(checkInterval);
|
||||||
|
clearInterval(timer);
|
||||||
|
};
|
||||||
|
}, [navigate, searchParams, message]);
|
||||||
|
|
||||||
|
const handleRetry = () => {
|
||||||
|
setCountdown(0);
|
||||||
|
setIsChecking(true);
|
||||||
|
setAuthSuccess(false);
|
||||||
|
window.location.href = '/authorization';
|
||||||
|
};
|
||||||
|
|
||||||
|
if (authSuccess) {
|
||||||
|
return (
|
||||||
|
<div style={{ minHeight: '100vh', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)' }}>
|
||||||
|
<div style={{ textAlign: 'center', padding: '60px 80px', background: '#fff', borderRadius: 16, boxShadow: '0 10px 40px rgba(0,0,0,0.1)' }}>
|
||||||
|
<div style={{ width: 80, height: 80, background: '#dcfce7', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center', margin: '0 auto 24px' }}>
|
||||||
|
<Typography.Text style={{ fontSize: 40, color: '#22c55e' }}>✓</Typography.Text>
|
||||||
|
</div>
|
||||||
|
<Typography.Title level={3} style={{ marginBottom: 16, color: '#1e293b' }}>授权成功</Typography.Title>
|
||||||
|
<Typography.Text style={{ color: '#64748b' }}>正在跳转至授权管理页面...</Typography.Text>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ minHeight: '100vh', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)' }}>
|
||||||
|
<div style={{ textAlign: 'center', padding: '60px 80px', background: '#fff', borderRadius: 16, boxShadow: '0 10px 40px rgba(0,0,0,0.1)' }}>
|
||||||
|
<div style={{ width: 80, height: 80, background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center', margin: '0 auto 24px' }}>
|
||||||
|
{isChecking && countdown < 10 ? (
|
||||||
|
<Spin size="large" tip="加载中" style={{ color: '#fff' }} />
|
||||||
|
) : (
|
||||||
|
<ClockCircleOutlined style={{ fontSize: 40, color: '#fff' }} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{countdown >= 10 ? (
|
||||||
|
<>
|
||||||
|
<Typography.Title level={3} style={{ marginBottom: 16, color: '#ef4444' }}>授权无响应</Typography.Title>
|
||||||
|
<Typography.Text style={{ color: '#64748b', marginBottom: 24, display: 'block' }}>请重新授权</Typography.Text>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
size="large"
|
||||||
|
icon={<ReloadOutlined />}
|
||||||
|
onClick={handleRetry}
|
||||||
|
style={{
|
||||||
|
borderRadius: 8,
|
||||||
|
background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',
|
||||||
|
border: 'none',
|
||||||
|
fontWeight: 600,
|
||||||
|
padding: '12px 32px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
重新授权
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Typography.Title level={3} style={{ marginBottom: 16, color: '#1e293b' }}>授权中,请等待</Typography.Title>
|
||||||
|
<Typography.Text style={{ color: '#64748b', marginBottom: 24, display: 'block' }}>
|
||||||
|
正在等待平台完成授权操作
|
||||||
|
</Typography.Text>
|
||||||
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8 }}>
|
||||||
|
<ClockCircleOutlined style={{ color: '#6366f1' }} />
|
||||||
|
<Typography.Text style={{ color: '#6366f1', fontWeight: 500, fontSize: 16 }}>
|
||||||
|
{countdown}s
|
||||||
|
</Typography.Text>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AuthorizationWaitingPage;
|
||||||
@@ -436,7 +436,7 @@ const PreTest: React.FC = () => {
|
|||||||
<div style={{ minHeight: 'calc(100vh - 80px)' }}>
|
<div style={{ minHeight: 'calc(100vh - 80px)' }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 12 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 12 }}>
|
||||||
<FileTextOutlined style={{ color: '#6366f1', fontSize: 16 }} />
|
<FileTextOutlined style={{ color: '#6366f1', fontSize: 16 }} />
|
||||||
<Typography.Text strong style={{ fontSize: 16 }}>前测管理</Typography.Text>
|
<Typography.Text strong style={{ fontSize: 16 }}>素材前测</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: 12, marginBottom: 16 }}>
|
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: 12, marginBottom: 16 }}>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user