fix(douyu): unify binding state and scheduler health
This commit is contained in:
@@ -130,6 +130,7 @@ const EVENT_LABELS: Record<string, string> = {
|
||||
binding_stale_role_ignored: '忽略账号旧角色',
|
||||
binding_synced_from_account: '同步账号最新角色绑定',
|
||||
binding_false_confirmation_reverted: '纠正误判的账号历史绑定',
|
||||
binding_pending_task_linked: '关联最新待确认角色',
|
||||
eligibility_check_failed: '兑换资格查询失败',
|
||||
eligibility_auto_refresh_failed: '自动刷新兑换资格失败',
|
||||
exchange_eligibility_checked: '刷新兑换资格',
|
||||
@@ -399,6 +400,7 @@ export default function PlatformFulfillmentPage() {
|
||||
const [selectedId, setSelectedId] = useState<number | null>(null);
|
||||
const [detail, setDetail] = useState<PlatformFulfillmentDetail | null>(null);
|
||||
const [detailLoading, setDetailLoading] = useState(false);
|
||||
const [bindingRefreshing, setBindingRefreshing] = useState(false);
|
||||
const [qrOpen, setQrOpen] = useState(false);
|
||||
const [bindingQrImage, setBindingQrImage] = useState('');
|
||||
const [bindingQrLoading, setBindingQrLoading] = useState(false);
|
||||
@@ -827,6 +829,27 @@ export default function PlatformFulfillmentPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const refreshSelectedBinding = async () => {
|
||||
if (!selectedId) return;
|
||||
setBindingRefreshing(true);
|
||||
try {
|
||||
const result = await platformFulfillmentApi.refreshBinding(selectedId);
|
||||
setDetail(result);
|
||||
await loadTasks(true);
|
||||
if (result.task.bindTask?.bindReadyForConfirm) {
|
||||
message.success(
|
||||
`当前待确认角色:${result.task.bindTask.roleName || '-'}`,
|
||||
);
|
||||
} else {
|
||||
message.success('角色绑定状态已刷新');
|
||||
}
|
||||
} catch (error) {
|
||||
message.error(getErrorMessage(error));
|
||||
} finally {
|
||||
setBindingRefreshing(false);
|
||||
}
|
||||
};
|
||||
|
||||
const closeDouyuAction = () => {
|
||||
setDouyuActionBatchId('');
|
||||
setDouyuActionTask(null);
|
||||
@@ -1666,8 +1689,8 @@ export default function PlatformFulfillmentPage() {
|
||||
<Button
|
||||
icon={<SyncOutlined />}
|
||||
disabled={!selected.account || !can('douyu:task')}
|
||||
loading={douyuActionLoading === 'query_game_name'}
|
||||
onClick={() => void runDouyuAccountAction('query_game_name')}
|
||||
loading={bindingRefreshing}
|
||||
onClick={() => void refreshSelectedBinding()}
|
||||
>
|
||||
刷新角色绑定
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user