优化(斗鱼预售台账): 统一命名并同步客户主页图
同步履约客户游戏主页截图,兼容 order_site 绝对 URL 与 objectKey;统一预售台账用户可见文案和保护标签;移除 CK 检测与重登前端页面入口。
This commit is contained in:
@@ -20,7 +20,6 @@ const PlatformFulfillmentPage = lazy(() => import('./pages/PlatformFulfillmentPa
|
||||
const AutomationPage = lazy(() => import('./pages/AutomationPage'));
|
||||
const UsersPage = lazy(() => import('./pages/UsersPage'));
|
||||
const CookiePage = lazy(() => import('./pages/CookiePage'));
|
||||
const CookieOperationsPage = lazy(() => import('./pages/CookieOperationsPage'));
|
||||
const DouyuTasksPage = lazy(() => import('./pages/DouyuTasksPage'));
|
||||
const DouyuCollabPage = lazy(() => import('./pages/DouyuCollabPage'));
|
||||
const HuyaAccountsPage = lazy(() => import('./pages/HuyaAccountsPage'));
|
||||
@@ -94,7 +93,6 @@ function AppContent() {
|
||||
<Route path="assignments" element={lazyRoute(<AssignmentsPage />)} />
|
||||
<Route path="login-tasks" element={lazyRoute(<LoginTasksPage />)} />
|
||||
<Route path="cookies" element={lazyRoute(<CookiePage />)} />
|
||||
<Route path="cookie-operations" element={lazyRoute(<CookieOperationsPage />)} />
|
||||
<Route path="douyu/tasks" element={<Navigate to="/douyu/elite" replace />} />
|
||||
<Route path="douyu/elite" element={lazyRoute(<DouyuTasksPage key="elite" handbook="elite" />)} />
|
||||
<Route path="douyu/esports" element={lazyRoute(<DouyuTasksPage key="esports" handbook="esports" />)} />
|
||||
|
||||
@@ -234,7 +234,7 @@ export default function DouyuCollabGiftModal({
|
||||
canManage ? (
|
||||
<Popconfirm
|
||||
title={`删除礼包「${row.name}」?`}
|
||||
description="仍有协作单使用该礼包时会被拒绝,可改用停用"
|
||||
description="仍有预售单使用该礼包时会被拒绝,可改用停用"
|
||||
onConfirm={() => void remove(row)}
|
||||
disabled={busy}
|
||||
>
|
||||
@@ -258,7 +258,7 @@ export default function DouyuCollabGiftModal({
|
||||
>
|
||||
<Space direction="vertical" size={10} style={{ width: '100%' }}>
|
||||
<Text type="secondary">
|
||||
先在这里维护标准礼包名和所需积分,新建协作单时直接选择。礼包名请按兑换记录里的名称填写;
|
||||
先在这里维护标准礼包名和所需积分,新建预售单时直接选择。礼包名请按兑换记录里的名称填写;
|
||||
停用只是不再出现在新建选择里,历史订单不受影响;改名会同步已有订单,改积分只影响之后新建的单。
|
||||
</Text>
|
||||
{canManage && (
|
||||
@@ -336,7 +336,7 @@ export default function DouyuCollabGiftModal({
|
||||
onChange={(event) => setEditRemark(event.target.value)}
|
||||
/>
|
||||
<Text type="secondary">
|
||||
改名会同步已有协作单上的礼包名;修改积分只影响之后新建的协作单,不会改变历史订单。
|
||||
改名会同步已有预售单上的礼包名;修改积分只影响之后新建的预售单,不会改变历史订单。
|
||||
</Text>
|
||||
</Space>
|
||||
</Modal>
|
||||
|
||||
@@ -23,7 +23,7 @@ import { getErrorMessage } from '../utils/error';
|
||||
const { Text } = Typography;
|
||||
|
||||
/**
|
||||
* 斗鱼店铺管理:先维护好店铺,新建协作单时直接点选。
|
||||
* 斗鱼店铺管理:先维护好店铺,新建预售单时直接点选。
|
||||
*
|
||||
* - 停用后不再出现在新建下拉里,历史订单不受影响;
|
||||
* - 重命名会自动同步已有订单上的店铺名,避免筛选出现新旧两个名字;
|
||||
@@ -233,7 +233,7 @@ export default function DouyuCollabShopModal({
|
||||
canManage ? (
|
||||
<Popconfirm
|
||||
title={`删除店铺「${row.name}」?`}
|
||||
description="仍有协作单使用该店铺时会被拒绝,避免误删历史归属"
|
||||
description="仍有预售单使用该店铺时会被拒绝,避免误删历史归属"
|
||||
onConfirm={() => void remove(row)}
|
||||
disabled={busy}
|
||||
>
|
||||
@@ -257,7 +257,7 @@ export default function DouyuCollabShopModal({
|
||||
>
|
||||
<Space direction="vertical" size={10} style={{ width: '100%' }}>
|
||||
<Text type="secondary">
|
||||
先在这里定义店铺,新建协作单时可以直接点选。停用只是不再出现在新建选择里,历史订单不受影响;
|
||||
先在这里定义店铺,新建预售单时可以直接点选。停用不再出现在新建选择里,历史订单不受影响;
|
||||
完整名称/别名只按这里手工维护的映射归并平台同步店铺;筛选仍使用规范简称。
|
||||
重命名会自动同步已有订单,已有订单仍在使用的店铺不能删除。
|
||||
</Text>
|
||||
@@ -306,7 +306,7 @@ export default function DouyuCollabShopModal({
|
||||
onChange={(event) => setRenameValue(event.target.value)}
|
||||
onPressEnter={() => void submitRename()}
|
||||
/>
|
||||
<Text type="secondary">保存后会同时更新已有协作单上的店铺名。</Text>
|
||||
<Text type="secondary">保存后会同时更新已有预售单上的店铺名。</Text>
|
||||
</Space>
|
||||
</Modal>
|
||||
</>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/**
|
||||
* 新建协作单时的「主页截图」上传(先传 OSS 拿 object_key,随表单一起提交)。
|
||||
* 新建预售单时的「主页截图」上传(先传 OSS 拿 object_key,随表单一起提交)。
|
||||
*
|
||||
* - 第一张就是封面(列表和详情都按第一张当封面);
|
||||
* - 新建时还没落库,所以预览用的地址来自上传接口返回的 thumbnail_url / url;
|
||||
* - 放进 `Form.Item name="home_images"`,值就是 object_key 数组;
|
||||
* - 放进 `Form.Item name="home_images"`,值通常是 object_key 数组;
|
||||
* - 从 order_site 同步来的图片已是绝对 URL,编辑时直接按原地址预览。
|
||||
* - 支持点击选择、拖拽,以及剪贴板里的截图直接 Ctrl/Cmd+V 粘贴。
|
||||
*/
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
@@ -22,6 +23,12 @@ const ACCEPT_ATTR = ACCEPTED_IMAGE_TYPES.join(',');
|
||||
|
||||
type Preview = Pick<FileUploadResult, 'url' | 'thumbnail_url'>;
|
||||
|
||||
function imagePreviewUrl(value: string, variant = ''): string {
|
||||
if (value.startsWith('/') || /^https?:\/\//i.test(value)) return value;
|
||||
const suffix = variant ? `&variant=${encodeURIComponent(variant)}` : '';
|
||||
return `/api/files/object?key=${encodeURIComponent(value)}${suffix}`;
|
||||
}
|
||||
|
||||
/** 从剪贴板里取图片文件;items 拿不到时退回 files。 */
|
||||
function clipboardImageFiles(data: DataTransfer | null): File[] {
|
||||
if (!data) return [];
|
||||
@@ -146,7 +153,7 @@ export default function HuyaCollabHomeImageUploader({
|
||||
</Text>
|
||||
) : (
|
||||
<Image.PreviewGroup
|
||||
items={keys.map((key) => previews[key]?.url || `/api/files/object?key=${encodeURIComponent(key)}`)}
|
||||
items={keys.map((key) => previews[key]?.url || imagePreviewUrl(key))}
|
||||
>
|
||||
<Space wrap size={12}>
|
||||
{keys.map((key, index) => (
|
||||
@@ -156,7 +163,7 @@ export default function HuyaCollabHomeImageUploader({
|
||||
src={
|
||||
previews[key]?.thumbnail_url
|
||||
|| previews[key]?.url
|
||||
|| `/api/files/object?key=${encodeURIComponent(key)}&variant=thumb`
|
||||
|| imagePreviewUrl(key, 'thumb')
|
||||
}
|
||||
width={88}
|
||||
height={88}
|
||||
|
||||
@@ -21,7 +21,7 @@ html[data-theme='dark'] body {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* 新建协作单弹窗:表单项间距压紧一点,配合紧凑布局尽量不出现滚动条 */
|
||||
/* 新建预售单弹窗:表单项间距压紧一点,配合紧凑布局尽量不出现滚动条 */
|
||||
.huya-collab-create .ant-form-item {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
@@ -74,9 +74,6 @@ export default function MainLayout({ onLogout }: { onLogout?: () => void }) {
|
||||
if (can('cookie:view')) {
|
||||
douyuItems.push({ key: '/cookies', label: 'Cookie 管理', icon: <KeyOutlined /> });
|
||||
}
|
||||
if (can('cookie:operate')) {
|
||||
douyuItems.push({ key: '/cookie-operations', label: 'CK 检测与重登', icon: <SafetyCertificateOutlined /> });
|
||||
}
|
||||
if (can('automation:view')) {
|
||||
douyuItems.push({ key: '/automation', label: '斗鱼自动化', icon: <RobotOutlined /> });
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ const EVENT_STYLE: Record<string, { label: string; color: string }> = {
|
||||
task_stopped: { label: '任务停止', color: 'orange' },
|
||||
query_completed: { label: '查询完成', color: 'blue' },
|
||||
lease_acquired: { label: '账号占用', color: 'cyan' },
|
||||
collab_synced: { label: '外部协作同步', color: 'geekblue' },
|
||||
collab_synced: { label: '预售台账同步', color: 'geekblue' },
|
||||
lease_released: { label: '账号释放', color: 'default' },
|
||||
};
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ const JOB_UI: Record<string, JobUiSpec> = {
|
||||
showConcurrency: false,
|
||||
},
|
||||
lease_ck_refresh: {
|
||||
description: "对仍有效、但预测 24 小时内到期的履约保护账号提前登录续 CK;覆盖预售、协作单和生效租约。",
|
||||
description: "对仍有效、但预测 24 小时内到期的履约保护账号提前登录续 CK;覆盖预售台账和生效租约。",
|
||||
core: true,
|
||||
showRecheck: false,
|
||||
showConcurrency: true,
|
||||
@@ -714,7 +714,7 @@ export default function AutomationPage() {
|
||||
showIcon
|
||||
style={{ marginBottom: 12 }}
|
||||
message="严格按 P0 > P1 > P2 > P3 > P4 顺序预留与调度"
|
||||
description="当剩余小时/日配额紧张时,低优先级类别会自动为高优先级类别让路;其中 P0/P1 涵盖预售、协作单和生效租约全部履约保护目标。"
|
||||
description="当剩余小时/日配额紧张时,低优先级类别会自动为高优先级类别让路;其中 P0/P1 涵盖预售台账和生效租约全部履约保护目标。"
|
||||
/>
|
||||
<Table
|
||||
rowKey="category"
|
||||
|
||||
@@ -1,312 +0,0 @@
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { Button, Input, Popconfirm, Select, Space, Table, Tag, Typography } from 'antd';
|
||||
import { message } from '../utils/antdMessage';
|
||||
import { LoadingOutlined, ReloadOutlined, SearchOutlined, StopOutlined } from '@ant-design/icons';
|
||||
import { cookieApi, type CookieOperationCheckResult, type CookieOperationItem } from '../api/modules';
|
||||
import { formatTime } from '../utils/time';
|
||||
import { getErrorMessage } from '../utils/error';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
export default function CookieOperationsPage() {
|
||||
const [items, setItems] = useState<CookieOperationItem[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [search, setSearch] = useState('');
|
||||
const [tagFilter, setTagFilter] = useState('');
|
||||
const [tags, setTags] = useState<string[]>([]);
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
|
||||
const [checkingIds, setCheckingIds] = useState<Set<number>>(new Set());
|
||||
const [reloginIds, setReloginIds] = useState<Set<number>>(new Set());
|
||||
const [checkResults, setCheckResults] = useState<Map<number, CookieOperationCheckResult>>(new Map());
|
||||
const [total, setTotal] = useState(0);
|
||||
const [pageSize, setPageSize] = useState(() => {
|
||||
const value = localStorage.getItem('cookie_operations_page_size');
|
||||
return value ? Number(value) || 20 : 20;
|
||||
});
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
|
||||
const loadItems = useCallback(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await cookieApi.listOperations({
|
||||
page: currentPage,
|
||||
page_size: pageSize,
|
||||
search: search.trim() || undefined,
|
||||
tag: tagFilter || undefined,
|
||||
});
|
||||
setItems(data.items);
|
||||
setTotal(data.total);
|
||||
setCheckResults((previous) => {
|
||||
const next = new Map(previous);
|
||||
for (const item of data.items) {
|
||||
if (!item.ck_check_status) continue;
|
||||
next.set(item.id, {
|
||||
id: item.id,
|
||||
valid: item.ck_check_status === 'valid',
|
||||
checked_at: item.ck_checked_at ?? '',
|
||||
});
|
||||
}
|
||||
return next;
|
||||
});
|
||||
} catch (error: unknown) {
|
||||
message.error(getErrorMessage(error));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [currentPage, pageSize, search, tagFilter]);
|
||||
|
||||
useEffect(() => {
|
||||
void loadItems();
|
||||
}, [loadItems]);
|
||||
|
||||
const hasActiveRelogin = items.some((item) => (
|
||||
item.relogin_status === 'relogin_pending' || item.relogin_status === 'relogin_running'
|
||||
));
|
||||
const activeReloginBatchIds = Array.from(new Set(items
|
||||
.filter((item) => item.relogin_status === 'relogin_pending' || item.relogin_status === 'relogin_running')
|
||||
.map((item) => item.relogin_batch_id)
|
||||
.filter(Boolean)));
|
||||
|
||||
useEffect(() => {
|
||||
if (!hasActiveRelogin) return;
|
||||
const timer = window.setInterval(() => void loadItems(), 2000);
|
||||
return () => window.clearInterval(timer);
|
||||
}, [hasActiveRelogin, loadItems]);
|
||||
|
||||
useEffect(() => {
|
||||
cookieApi.listOperationTags().then(setTags).catch(() => {
|
||||
// 标签加载失败不影响 CK 检测与重登。
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleCheck = async (ids: number[]) => {
|
||||
if (ids.length === 0) return;
|
||||
setCheckingIds((previous) => new Set([...previous, ...ids]));
|
||||
try {
|
||||
const response = await cookieApi.checkOperations(ids);
|
||||
setCheckResults((previous) => {
|
||||
const next = new Map(previous);
|
||||
response.results.forEach((item) => next.set(item.id, item));
|
||||
return next;
|
||||
});
|
||||
message.success(`检测完成:${response.results.filter((item) => item.valid).length}/${response.results.length} 条有效`);
|
||||
void loadItems();
|
||||
} catch (error: unknown) {
|
||||
message.error(getErrorMessage(error));
|
||||
} finally {
|
||||
setCheckingIds((previous) => {
|
||||
const next = new Set(previous);
|
||||
ids.forEach((id) => next.delete(id));
|
||||
return next;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const handleRelogin = async (ids: number[]) => {
|
||||
if (ids.length === 0) return;
|
||||
setReloginIds((previous) => new Set([...previous, ...ids]));
|
||||
try {
|
||||
const response = await cookieApi.reloginOperations(ids);
|
||||
const skipped = response.skipped ? `,${response.skipped} 条因缺少登录凭据跳过` : '';
|
||||
message.success(`已开始重登 ${response.count} 个账号${skipped}`);
|
||||
setSelectedRowKeys([]);
|
||||
window.setTimeout(() => void loadItems(), 1000);
|
||||
} catch (error: unknown) {
|
||||
message.error(getErrorMessage(error));
|
||||
} finally {
|
||||
setReloginIds((previous) => {
|
||||
const next = new Set(previous);
|
||||
ids.forEach((id) => next.delete(id));
|
||||
return next;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const handleReloginInvalid = async () => {
|
||||
try {
|
||||
const response = await cookieApi.reloginInvalidOperations({
|
||||
search: search.trim() || undefined,
|
||||
tag: tagFilter || undefined,
|
||||
});
|
||||
const skipped = response.skipped ? `,${response.skipped} 条因缺少登录凭据跳过` : '';
|
||||
message.success(`已开始重登 ${response.count} 个失效账号${skipped}`);
|
||||
setSelectedRowKeys([]);
|
||||
void loadItems();
|
||||
} catch (error: unknown) {
|
||||
message.error(getErrorMessage(error));
|
||||
}
|
||||
};
|
||||
|
||||
const handleStopRelogin = async () => {
|
||||
if (activeReloginBatchIds.length === 0) return;
|
||||
try {
|
||||
await Promise.all(activeReloginBatchIds.map((batchId) => cookieApi.stopOperationRelogin(batchId)));
|
||||
message.success('已发送停止信号');
|
||||
void loadItems();
|
||||
} catch (error: unknown) {
|
||||
message.error(getErrorMessage(error));
|
||||
}
|
||||
};
|
||||
|
||||
const resultFor = (item: CookieOperationItem) => checkResults.get(item.id);
|
||||
const selectedIds = selectedRowKeys.map((key) => Number(key));
|
||||
const reloginStatus = (item: CookieOperationItem) => {
|
||||
if (item.relogin_status === 'relogin_pending') return <Tag color="processing">重登排队中</Tag>;
|
||||
if (item.relogin_status === 'relogin_running') return <Tag color="processing" icon={<LoadingOutlined />}>重登中</Tag>;
|
||||
if (item.relogin_status === 'relogin_failed') return <Tag color="error">重登失败</Tag>;
|
||||
if (item.relogin_message.startsWith('重新登录成功')) return <Tag color="success">重登成功</Tag>;
|
||||
return <Text type="secondary">-</Text>;
|
||||
};
|
||||
const columns = [
|
||||
{ title: '账号', dataIndex: 'account_username', ellipsis: true },
|
||||
{
|
||||
title: '标签',
|
||||
dataIndex: 'tag',
|
||||
width: 140,
|
||||
ellipsis: true,
|
||||
render: (tag: string) => tag ? <Tag color="blue">{tag}</Tag> : <Text type="secondary">-</Text>,
|
||||
},
|
||||
{
|
||||
title: '有效性',
|
||||
width: 110,
|
||||
render: (_: unknown, item: CookieOperationItem) => {
|
||||
if (checkingIds.has(item.id)) return <Tag color="processing" icon={<LoadingOutlined />}>检测中</Tag>;
|
||||
const result = resultFor(item);
|
||||
if (!result) return <Text type="secondary">未检测</Text>;
|
||||
return <Tag color={result.valid ? 'success' : 'error'}>{result.valid ? '有效' : '无效'}</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '检测时间',
|
||||
width: 180,
|
||||
render: (_: unknown, item: CookieOperationItem) => {
|
||||
const checkedAt = resultFor(item)?.checked_at || item.ck_checked_at;
|
||||
return checkedAt ? formatTime(checkedAt) : <Text type="secondary">-</Text>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '重登状态',
|
||||
width: 130,
|
||||
render: (_: unknown, item: CookieOperationItem) => (
|
||||
<Space direction="vertical" size={0}>
|
||||
{reloginStatus(item)}
|
||||
{item.relogin_status === 'relogin_failed' && item.relogin_message ? (
|
||||
<Text type="secondary" ellipsis style={{ maxWidth: 180, fontSize: 12 }} title={item.relogin_message}>
|
||||
{item.relogin_message}
|
||||
</Text>
|
||||
) : null}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 190,
|
||||
render: (_: unknown, item: CookieOperationItem) => (
|
||||
<Space size={4}>
|
||||
<Button
|
||||
size="small"
|
||||
loading={checkingIds.has(item.id)}
|
||||
disabled={checkingIds.has(item.id) || item.relogin_status === 'relogin_pending' || item.relogin_status === 'relogin_running'}
|
||||
onClick={() => void handleCheck([item.id])}
|
||||
>
|
||||
检测
|
||||
</Button>
|
||||
<Popconfirm title="将使用已保存的账号信息重新登录并替换 CK,确认继续?" onConfirm={() => void handleRelogin([item.id])}>
|
||||
<Button
|
||||
size="small"
|
||||
icon={<ReloadOutlined />}
|
||||
loading={reloginIds.has(item.id)}
|
||||
disabled={reloginIds.has(item.id) || item.relogin_status === 'relogin_pending' || item.relogin_status === 'relogin_running'}
|
||||
>
|
||||
重登
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ marginBottom: 16, display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 12 }}>
|
||||
<h2 style={{ margin: 0 }}>CK 检测与重登</h2>
|
||||
<Space wrap>
|
||||
<Button loading={checkingIds.size > 0} disabled={selectedIds.length === 0} onClick={() => void handleCheck(selectedIds)}>
|
||||
检测选中 {selectedIds.length > 0 ? `(${selectedIds.length})` : ''}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
title={`将重新登录选中的 ${selectedIds.length} 个账号并替换 CK,确认继续?`}
|
||||
disabled={selectedIds.length === 0}
|
||||
onConfirm={() => void handleRelogin(selectedIds)}
|
||||
>
|
||||
<Button icon={<ReloadOutlined />} disabled={selectedIds.length === 0}>
|
||||
重登选中 {selectedIds.length > 0 ? `(${selectedIds.length})` : ''}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
title="将重新登录当前筛选范围内所有已检测为无效的账号,并在成功后替换旧 CK,确认继续?"
|
||||
onConfirm={() => void handleReloginInvalid()}
|
||||
>
|
||||
<Button icon={<ReloadOutlined />}>
|
||||
批量重登失效账号
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
{activeReloginBatchIds.length > 0 ? (
|
||||
<Popconfirm title="确认停止当前重登任务?旧 CK 会保留。" onConfirm={() => void handleStopRelogin()}>
|
||||
<Button danger icon={<StopOutlined />}>停止重登</Button>
|
||||
</Popconfirm>
|
||||
) : null}
|
||||
</Space>
|
||||
</div>
|
||||
<Space wrap style={{ marginBottom: 12 }}>
|
||||
<Select
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder="按标签筛选"
|
||||
style={{ width: 160 }}
|
||||
value={tagFilter || undefined}
|
||||
onChange={(value) => {
|
||||
setTagFilter(value || '');
|
||||
setCurrentPage(1);
|
||||
setSelectedRowKeys([]);
|
||||
}}
|
||||
options={tags.map((tag) => ({ value: tag, label: tag }))}
|
||||
/>
|
||||
<Input.Search
|
||||
allowClear
|
||||
prefix={<SearchOutlined />}
|
||||
placeholder="搜索账号或标签"
|
||||
style={{ width: 280 }}
|
||||
value={search}
|
||||
onChange={(event) => {
|
||||
setSearch(event.target.value);
|
||||
setCurrentPage(1);
|
||||
setSelectedRowKeys([]);
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
<Table
|
||||
rowKey="id"
|
||||
size="small"
|
||||
loading={loading}
|
||||
columns={columns}
|
||||
dataSource={items}
|
||||
rowSelection={{ selectedRowKeys, onChange: setSelectedRowKeys, preserveSelectedRowKeys: true }}
|
||||
pagination={{
|
||||
current: currentPage,
|
||||
pageSize,
|
||||
total,
|
||||
showSizeChanger: true,
|
||||
showTotal: (count) => `共 ${count} 条`,
|
||||
onChange: (page, size) => {
|
||||
setCurrentPage(size === pageSize ? page : 1);
|
||||
if (size !== pageSize) {
|
||||
setPageSize(size);
|
||||
localStorage.setItem('cookie_operations_page_size', String(size));
|
||||
}
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -656,13 +656,13 @@ export default function DouyuCollabPage() {
|
||||
if (updated.status === 'incomplete' && updated.missing_fields?.length) {
|
||||
message.warning(`资料已保存,但仍缺:${updated.missing_fields.join('、')}`);
|
||||
} else if (editing.status === 'incomplete') {
|
||||
message.success('资料已补齐,协作单已自动进入待充值');
|
||||
message.success('资料已补齐,预售单已自动进入待充值');
|
||||
} else {
|
||||
message.success('协作单已更新');
|
||||
message.success('预售单已更新');
|
||||
}
|
||||
} else {
|
||||
message.success(
|
||||
updated.status === 'incomplete' ? '已创建待补资料协作单' : '协作单已创建',
|
||||
updated.status === 'incomplete' ? '已创建待补资料预售单' : '预售单已创建',
|
||||
);
|
||||
}
|
||||
setCreateOpen(false);
|
||||
@@ -678,7 +678,7 @@ export default function DouyuCollabPage() {
|
||||
setSubmitting(false);
|
||||
modal.confirm({
|
||||
title: '平台履约账号需要转人工',
|
||||
content: `${getErrorMessage(error)}。确认后平台履约任务会转为人工,并由当前协作单接管账号。`,
|
||||
content: `${getErrorMessage(error)}。确认后平台履约任务会转为人工,并由当前预售单接管账号。`,
|
||||
okText: '确认接管并转人工',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
@@ -935,7 +935,7 @@ export default function DouyuCollabPage() {
|
||||
|
||||
const openBatchStatus = () => {
|
||||
if (selectedIds.length === 0) {
|
||||
message.warning('请先勾选协作单');
|
||||
message.warning('请先勾选预售单');
|
||||
return;
|
||||
}
|
||||
setStatusTarget(null);
|
||||
@@ -1010,7 +1010,7 @@ export default function DouyuCollabPage() {
|
||||
|
||||
const batchQueryBalances = async () => {
|
||||
if (selectedIds.length === 0) {
|
||||
message.warning('请先勾选协作单');
|
||||
message.warning('请先勾选预售单');
|
||||
return;
|
||||
}
|
||||
setBalanceQuerying(true);
|
||||
@@ -1028,7 +1028,7 @@ export default function DouyuCollabPage() {
|
||||
|
||||
const batchQueryRecords = async () => {
|
||||
if (selectedIds.length === 0) {
|
||||
message.warning('请先勾选协作单');
|
||||
message.warning('请先勾选预售单');
|
||||
return;
|
||||
}
|
||||
setRecordQuerying(true);
|
||||
@@ -1049,7 +1049,7 @@ export default function DouyuCollabPage() {
|
||||
|
||||
const batchVerify = async () => {
|
||||
if (selectedIds.length === 0) {
|
||||
message.warning('请先勾选协作单');
|
||||
message.warning('请先勾选预售单');
|
||||
return;
|
||||
}
|
||||
setLoading(true);
|
||||
@@ -1084,7 +1084,7 @@ export default function DouyuCollabPage() {
|
||||
|
||||
const openCkExport = async () => {
|
||||
if (selectedIds.length === 0) {
|
||||
message.warning('请先勾选协作单');
|
||||
message.warning('请先勾选预售单');
|
||||
return;
|
||||
}
|
||||
setCkExporting(true);
|
||||
@@ -1114,7 +1114,7 @@ export default function DouyuCollabPage() {
|
||||
}
|
||||
};
|
||||
|
||||
/** 单行复制:斗鱼协作单不存 CK,这里实时读取关联内部账号的 cookie。 */
|
||||
/** 单行复制:斗鱼预售单不存 CK,这里实时读取关联内部账号的 cookie。 */
|
||||
const copyOneCk = async (row: DouyuCollabOrder) => {
|
||||
setCkCopyingId(row.id);
|
||||
try {
|
||||
@@ -1147,7 +1147,7 @@ export default function DouyuCollabPage() {
|
||||
|
||||
const openUsernameExport = async () => {
|
||||
if (selectedIds.length === 0) {
|
||||
message.warning('请先勾选协作单');
|
||||
message.warning('请先勾选预售单');
|
||||
return;
|
||||
}
|
||||
setUsernameExporting(true);
|
||||
@@ -1241,7 +1241,7 @@ export default function DouyuCollabPage() {
|
||||
|
||||
const deleteOrder = (order: DouyuCollabOrder) => {
|
||||
modal.confirm({
|
||||
title: `删除协作单 ${order.order_no}?`,
|
||||
title: `删除预售单 ${order.order_no}?`,
|
||||
content: '只删除这一行台账,不会删除内部斗鱼账号,也不会清理已上传图片。',
|
||||
okButtonProps: { danger: true },
|
||||
onOk: async () => {
|
||||
@@ -2039,7 +2039,7 @@ export default function DouyuCollabPage() {
|
||||
)}
|
||||
{canEdit && (
|
||||
<Button type="primary" icon={<PlusOutlined />} onClick={openCreate}>
|
||||
新建协作单
|
||||
新建预售单
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
@@ -2151,7 +2151,7 @@ export default function DouyuCollabPage() {
|
||||
/>
|
||||
|
||||
<Modal
|
||||
title={editing ? `编辑协作单 ${editing.order_no}` : '新建协作单'}
|
||||
title={editing ? `编辑预售单 ${editing.order_no}` : '新建预售单'}
|
||||
open={createOpen}
|
||||
width={820}
|
||||
onCancel={() => setCreateOpen(false)}
|
||||
@@ -2431,7 +2431,7 @@ export default function DouyuCollabPage() {
|
||||
type="warning"
|
||||
showIcon
|
||||
message={`将解除账号「${form.account_username || '-'}」与本单的关联`}
|
||||
description="不会删除内部账号。账号身份、角色、鱼翅和积分快照会清空,订单回到待补资料;如果账号仍被履约任务或其他活动协作单占用,不会释放其租约。"
|
||||
description="不会删除内部账号。账号身份、角色、鱼翅和积分快照会清空,订单回到待补资料;如果账号仍被履约任务或其他预售单占用,不会释放其租约。"
|
||||
/>
|
||||
<Input.TextArea
|
||||
rows={3}
|
||||
@@ -2468,7 +2468,7 @@ export default function DouyuCollabPage() {
|
||||
type="info"
|
||||
showIcon
|
||||
message="推荐结果不会预占账号"
|
||||
description="选择后会再次实时校验 CK、租约、活动协作单和换绑冷却。未绑定账号优先;关闭下方开关后只搜索未绑定账号。"
|
||||
description="选择后会再次实时校验 CK、租约、活动预售单和换绑冷却。未绑定账号优先;关闭下方开关后只搜索未绑定账号。"
|
||||
/>
|
||||
<Space>
|
||||
<Switch
|
||||
@@ -2734,7 +2734,7 @@ export default function DouyuCollabPage() {
|
||||
type="warning"
|
||||
showIcon
|
||||
message="账号、密码、CK 都是凭据"
|
||||
description="格式与「CK 管理」一致:账号----密码----CK,每行一条。斗鱼协作单不存 CK,这里导出的是关联内部账号当前的 CK。复制后请勿发群 / 截图外传;每次导出都会写审计,审计里不存凭据本体。"
|
||||
description="格式与「CK 管理」一致:账号----密码----CK,每行一条。斗鱼预售单不存 CK,这里导出的是关联内部账号当前的 CK。复制后请勿发群 / 截图外传;每次导出都会写审计,审计里不存凭据本体。"
|
||||
/>
|
||||
{ckExport && ckExport.skipped.length > 0 && (
|
||||
<Text type="warning" style={{ fontSize: 12 }}>
|
||||
@@ -2791,7 +2791,7 @@ export default function DouyuCollabPage() {
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
'协作单详情'
|
||||
'预售单详情'
|
||||
)
|
||||
}
|
||||
open={detailOpen}
|
||||
|
||||
@@ -144,7 +144,7 @@ export const CK_META: Record<string, { label: string; color: string }> = {
|
||||
};
|
||||
|
||||
export const COLLAB_ACTION_LABELS: Record<string, string> = {
|
||||
'douyu:collab:create': '新建协作单',
|
||||
'douyu:collab:create': '新建预售单',
|
||||
'douyu:collab:update': '编辑订单资料',
|
||||
'douyu:collab:account': '更换账号',
|
||||
'douyu:collab:account_unlink': '解除账号关联',
|
||||
@@ -250,7 +250,7 @@ export const COLLAB_DETAIL_VALUE_LABELS: Record<string, string> = {
|
||||
balance_batch: '批量查询鱼翅与积分',
|
||||
batch: '批量查询',
|
||||
platform_fulfillment: '直播账号履约',
|
||||
douyu_collab: '外部单协作',
|
||||
douyu_collab: '斗鱼预售台账',
|
||||
};
|
||||
|
||||
export const COLLAB_DETAIL_PREFERRED_KEYS = Object.keys(COLLAB_DETAIL_LABELS);
|
||||
|
||||
@@ -333,7 +333,7 @@ function eventDescription(event: { eventType: string; detail: Record<string, unk
|
||||
eligible ? `具备资格账号 ${eligible}` : '',
|
||||
roleCooldown ? `换绑冷却 ${roleCooldown}` : '',
|
||||
leased ? `任务租约占用 ${leased}` : '',
|
||||
collab ? `协作单占用 ${collab}` : '',
|
||||
collab ? `预售台账占用 ${collab}` : '',
|
||||
].filter(Boolean);
|
||||
return summary.length
|
||||
? `${summary.join(';')},当前没有空闲账号`
|
||||
|
||||
@@ -16,7 +16,7 @@ const { Text } = Typography;
|
||||
|
||||
const SUPPLY_ROLE_LABELS: Record<string, string> = {
|
||||
fulfillment_protected: '履约保护',
|
||||
collab_protected: '协作保护',
|
||||
collab_protected: '预售台账保护',
|
||||
onboarding: '待首次登录',
|
||||
repair: '待重登',
|
||||
supply_high: '高价值供给',
|
||||
|
||||
@@ -671,7 +671,7 @@ export default function AccountPlatformStatusPanel() {
|
||||
<Space orientation="vertical" size={2} style={{ width: '100%', marginTop: 20 }}>
|
||||
<Text strong>履约保护目标</Text>
|
||||
<Text type="secondary">
|
||||
保持预售与外部协作单绑定账号的 CK 有效,失效后优先进入自动重登队列
|
||||
保持预售及预售台账绑定账号的 CK 有效,失效后优先进入自动重登队列
|
||||
</Text>
|
||||
</Space>
|
||||
<Table
|
||||
|
||||
Reference in New Issue
Block a user