feat: split worker login device limits by type

This commit is contained in:
yml2213
2026-08-30 21:58:13 +08:00
parent ffb71f2276
commit b832279c1f
15 changed files with 537 additions and 14 deletions
@@ -662,7 +662,7 @@ export default function WorkerLoginPage() {
<Alert
showIcon
type="info"
message="验证账号密码后,可删除旧设备。所有 PC 和手机合计最多同时在线 3 台。"
message="验证账号密码后,可删除旧设备。PC 和手机分别最多同时在线 3 台。"
style={{ marginBottom: 16 }}
/>
<Table
@@ -38,6 +38,7 @@ export function WorkerProfileAccountModals({
setDevicesOpen,
devices,
maxDevices,
deviceCounts,
devicesLoading,
removeWorkerDevice,
passwordOpen,
@@ -60,6 +61,7 @@ export function WorkerProfileAccountModals({
setDevicesOpen: (open: boolean) => void
devices: WorkerSessionDevice[]
maxDevices: number
deviceCounts: { pc: number; mobile: number }
devicesLoading: boolean
removeWorkerDevice: (device: WorkerSessionDevice) => Promise<void>
passwordOpen: boolean
@@ -88,7 +90,7 @@ export function WorkerProfileAccountModals({
<Alert
showIcon
type="info"
message={`所有设备合计最多同时在线 ${maxDevices} 台,删除旧设备后才能在新设备登录。`}
message={`PC 和手机分别最多同时在线 ${maxDevices} 台(当前 PC ${deviceCounts.pc} 台、手机 ${deviceCounts.mobile} 台),删除对应旧设备后才能登录。`}
/>
<Table<WorkerSessionDevice>
size="small"
@@ -658,6 +658,7 @@ export default function WorkerProfilePage() {
setDevicesOpen={setDevicesOpen}
devices={devicesQuery.data?.data.items || []}
maxDevices={devicesQuery.data?.data.maxDevices || 3}
deviceCounts={devicesQuery.data?.data.deviceCounts || { pc: 0, mobile: 0 }}
devicesLoading={devicesQuery.isLoading || devicesQuery.isFetching}
removeWorkerDevice={removeWorkerDevice}
passwordOpen={passwordOpen}