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:
@@ -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;
|
||||
|
||||
@@ -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}` : ''}
|
||||
|
||||
Reference in New Issue
Block a user