From 25098b9f8162bf9a529202c902e3efefa5c6576b Mon Sep 17 00:00:00 2001 From: Rogee Date: Mon, 28 Sep 2026 22:30:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E5=87=BA=E5=8F=A3=E9=87=8D?= =?UTF-8?q?=E7=BB=91=E6=94=B9=E8=B5=B0=20POST=20/browsers/:alias/rebind?= =?UTF-8?q?=EF=BC=88=E5=8E=9F=20/network-exits/:id/rebind=20=E6=97=A0?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=90=8E=E7=AB=AF=E8=B7=AF=E7=94=B1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/accounts/RebindEnvironment.tsx | 7 ++++--- web/src/pages/accounts/$id/index.tsx | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/components/accounts/RebindEnvironment.tsx b/web/src/components/accounts/RebindEnvironment.tsx index cc95314..e25f503 100644 --- a/web/src/components/accounts/RebindEnvironment.tsx +++ b/web/src/components/accounts/RebindEnvironment.tsx @@ -1,18 +1,19 @@ // 账号环境出口重绑:账号即环境下唯一的换绑入口(环境跟随账号,不再有独立环境页)。 -// 仅列举检测通过的出口;重绑走 POST /network-exits/:id/rebind(后端联动账号环境),成功后由父级刷新。 +// 仅列举检测通过的出口;重绑走 POST /browsers/:alias/rebind(alias=账号 ID,成功后由父级刷新)。 import { useEffect, useMemo, useState } from 'react'; import { Button, Flex, Select, Typography } from 'antd'; import { getList } from '@/services/api'; import { jsonOptions, request } from '@/requestErrorConfig'; interface RebindEnvironmentProps { + accountID: string; binding: any; disabled?: boolean; onRebound: () => void | Promise; onError: (error: unknown) => void; } -export default function RebindEnvironment({ binding, disabled, onRebound, onError }: RebindEnvironmentProps) { +export default function RebindEnvironment({ accountID, binding, disabled, onRebound, onError }: RebindEnvironmentProps) { const [exits, setExits] = useState([]); const [exitsError, setExitsError] = useState(false); const [exitID, setExitID] = useState(''); @@ -47,7 +48,7 @@ export default function RebindEnvironment({ binding, disabled, onRebound, onErro async function rebind() { setBusy(true); try { - await request(`/network-exits/${encodeURIComponent(binding.network_exit_id ?? '')}/rebind`, jsonOptions('POST', { network_exit_id: exitID })); + await request(`/browsers/${encodeURIComponent(accountID)}/rebind`, jsonOptions('POST', { network_exit_id: exitID })); await onRebound(); } catch (reason) { onError(reason); diff --git a/web/src/pages/accounts/$id/index.tsx b/web/src/pages/accounts/$id/index.tsx index 7d0531b..8b84df5 100644 --- a/web/src/pages/accounts/$id/index.tsx +++ b/web/src/pages/accounts/$id/index.tsx @@ -283,6 +283,7 @@ export default function Page() { {binding.schedule_block_reason || '无'} {