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 || '无'} {