fix(platform): 支持保留账号刷新绑定二维码
This commit is contained in:
@@ -294,6 +294,11 @@ function canResetBinding(task: PlatformFulfillmentTask) {
|
||||
return task.bindingStatus === 'failed';
|
||||
}
|
||||
|
||||
function canRefreshBindingQr(task: PlatformFulfillmentTask) {
|
||||
if (!task.account) return false;
|
||||
return !['role_ready', 'bound', 'completed', 'cancelled'].includes(task.executionStatus);
|
||||
}
|
||||
|
||||
export default function PlatformFulfillmentPage() {
|
||||
const user = getUser();
|
||||
const navigate = useNavigate();
|
||||
@@ -917,9 +922,9 @@ export default function PlatformFulfillmentPage() {
|
||||
人工重试选号
|
||||
</Button>
|
||||
) : null}
|
||||
{['waiting_bind', 'binding_confirming'].includes(task.executionStatus) ? (
|
||||
<Button size="small" icon={<ReloadOutlined />} onClick={() => void runTaskAction(() => platformFulfillmentApi.refreshBinding(task.id))}>
|
||||
刷新绑定
|
||||
{canRefreshBindingQr(task) ? (
|
||||
<Button size="small" icon={<ReloadOutlined />} onClick={() => void runTaskAction(() => platformFulfillmentApi.startBinding(task.id))}>
|
||||
刷新二维码
|
||||
</Button>
|
||||
) : null}
|
||||
{task.executionStatus === 'role_ready' ? (
|
||||
@@ -964,6 +969,14 @@ export default function PlatformFulfillmentPage() {
|
||||
释放并重新选号
|
||||
</Button>
|
||||
) : null}
|
||||
{selected && canRefreshBindingQr(selected) ? (
|
||||
<Button
|
||||
icon={<ReloadOutlined />}
|
||||
onClick={() => void runTaskAction(() => platformFulfillmentApi.startBinding(selected.id))}
|
||||
>
|
||||
刷新二维码
|
||||
</Button>
|
||||
) : null}
|
||||
{selected.account &&
|
||||
selected.executionStatus !== 'completed' &&
|
||||
selected.executionStatus !== 'cancelled' &&
|
||||
|
||||
Reference in New Issue
Block a user