feat(douyu): unify account probes and lifecycle writes

Centralize Douyu client creation, CK session probing, identity refresh, role alias resolution, capability persistence, cache and batch throttling across collaboration, fulfillment, tasks and cookie management. Add the account-name copy action in the collaboration table.
This commit is contained in:
yml
2026-11-20 01:55:25 +08:00
parent e9937419cb
commit 1a49bcd481
24 changed files with 2162 additions and 639 deletions
+2
View File
@@ -202,6 +202,8 @@ export interface DouyuCollabAccountLookup {
account_nickname: string;
ck_status: string;
ck_status_label: string;
auth_status: string;
role_status: string;
manual_type: number | null;
manual_score: number | null;
expire_time: number | null;
+33 -9
View File
@@ -1018,6 +1018,16 @@ export default function DouyuCollabPage() {
}
};
const copyAccountUsername = async (row: DouyuCollabOrder) => {
if (!row.account_username) return;
try {
await copyTextToClipboard(row.account_username);
message.success(`已复制斗鱼账号 ${row.account_username}`);
} catch (error) {
message.error(`复制失败:${getErrorMessage(error)}`);
}
};
const openUsernameExport = async () => {
if (selectedIds.length === 0) {
message.warning('请先勾选协作单');
@@ -1218,15 +1228,29 @@ export default function DouyuCollabPage() {
width: 210,
render: (_, row) => (
<Space direction="vertical" size={0}>
<Button
type="link"
size="small"
style={{ padding: 0 }}
disabled={!row.account_id}
onClick={() => row.account_id && navigate(`/accounts/${row.account_id}`)}
>
{row.account_username || '未填'}
</Button>
<Space size={2}>
<Button
type="link"
size="small"
style={{ padding: 0 }}
disabled={!row.account_id}
onClick={() => row.account_id && navigate(`/accounts/${row.account_id}`)}
>
{row.account_username || '未填'}
</Button>
{row.account_username && (
<Tooltip title="复制斗鱼账号">
<Button
type="text"
size="small"
style={{ paddingInline: 4 }}
aria-label="复制斗鱼账号"
icon={<CopyOutlined />}
onClick={() => void copyAccountUsername(row)}
/>
</Tooltip>
)}
</Space>
<Text type="secondary" style={{ fontSize: 12 }}>
{row.account_nickname || '-'}
{row.account_uid ? ` · UID ${row.account_uid}` : ''}