fix(fulfillment): 对齐客户确认状态并展示角色接口日志

- 客户页 bindReadyForConfirm 与平台任务 role_ready 对齐
- 详情返回 douyu_role_api_logs 最近 40 条
- 详情页增加角色接口日志诊断表
- 补充客户确认、日志读取回归测试
- 文档记录 11.22 成功 HAR 与角色日志时间线
This commit is contained in:
yml
2026-11-24 15:03:35 +08:00
parent 47be8646bf
commit 9c8ef3d497
5 changed files with 198 additions and 1 deletions
+22
View File
@@ -2594,9 +2594,31 @@ export interface PlatformFulfillmentEvent {
createdAt: string;
}
export interface PlatformFulfillmentBindingLog {
id: number;
taskId: number | null;
stage: string;
source: string;
actAlias: string;
apiVersion: string;
roleName: string;
areaName: string;
platName: string;
bindAct: boolean;
bindRole: boolean;
needBindAct: boolean;
needBindRole: boolean;
changeRoleWaitTime: number | null;
canChangeTime: number | null;
error: unknown;
message: string;
createdAt: string;
}
export interface PlatformFulfillmentDetail {
task: PlatformFulfillmentTask;
events: PlatformFulfillmentEvent[];
bindingLogs?: PlatformFulfillmentBindingLog[];
}
export interface PlatformFulfillmentAllocationResult extends PlatformFulfillmentDetail {
@@ -6,7 +6,7 @@ import { Alert, Button, Card, Col, DatePicker, Descriptions, Drawer, Empty, Inpu
import { CheckCircleOutlined, CopyOutlined, CreditCardOutlined, DownloadOutlined, GiftOutlined, LinkOutlined, QrcodeOutlined, ReloadOutlined, SettingOutlined, ShoppingOutlined, SyncOutlined, UndoOutlined, UserSwitchOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table';
import { douyuApi, platformFulfillmentApi } from '../api/modules';
import type { DouyuGoodsItem, DouyuTaskItem, PlatformFulfillmentDetail, PlatformFulfillmentMapping, PlatformFulfillmentSettings, PlatformFulfillmentTask } from '../api/modules';
import type { DouyuGoodsItem, DouyuTaskItem, PlatformFulfillmentBindingLog, PlatformFulfillmentDetail, PlatformFulfillmentMapping, PlatformFulfillmentSettings, PlatformFulfillmentTask } from '../api/modules';
import ExchangeResultImage from '../components/ExchangeResultImage';
import { copyImageToClipboard, fetchExchangeImageBlob, getExchangeImage, isExchangeTask } from '../utils/exchangeImage';
import { TASK_STATUS_COLORS, TASK_STATUS_LABELS, taskQrUrl } from './douyu-tasks/config';
@@ -1889,6 +1889,49 @@ export default function PlatformFulfillmentPage() {
)}
</Card>
<Card size="small" title="角色接口日志(诊断)">
{detail?.bindingLogs?.length ? (
<Table<PlatformFulfillmentBindingLog>
size="small"
rowKey="id"
pagination={false}
dataSource={detail.bindingLogs}
scroll={{ x: 980, y: 260 }}
columns={[
{
title: '时间',
dataIndex: 'createdAt',
width: 150,
render: (value: string) => formatTime(value),
},
{ title: '阶段', dataIndex: 'stage', width: 170 },
{ title: '通道', dataIndex: 'actAlias', width: 140 },
{ title: '角色', dataIndex: 'roleName', width: 120 },
{
title: 'bindAct',
dataIndex: 'bindAct',
width: 76,
render: (value: boolean) => (value ? '1' : '0'),
},
{
title: '换绑等待',
dataIndex: 'changeRoleWaitTime',
width: 96,
render: (value: number | null) => value ?? '-',
},
{
title: '结果',
dataIndex: 'message',
render: (value: string, row: PlatformFulfillmentBindingLog) =>
row.error === 0 ? 'OK' : `${String(row.error ?? '')} ${value || ''}`.trim(),
},
]}
/>
) : (
<Text type="secondary">暂无接口日志</Text>
)}
</Card>
<Card size="small" title="精英宝典操作">
<Space direction="vertical" size={12} style={{ width: '100%' }}>
<Text type="secondary">