diff --git a/web/src/pages/accounts/$id/edit.tsx b/web/src/pages/accounts/$id/edit.tsx index cec5e3d..69e4434 100644 --- a/web/src/pages/accounts/$id/edit.tsx +++ b/web/src/pages/accounts/$id/edit.tsx @@ -1,7 +1,10 @@ // 编辑社媒账号:账号资料维护 + 登录二维码/身份核验。 +// 布局对齐全站模式:实体标识经 usePageInfo 进页头 content 左侧,返回/登录操作按钮经 usePageActions 进页头右侧; +// 主体两张 Card 纵向堆叠(登录状态 / 账号资料),不再自绘标题行、不再裸铺背景。 import { useCallback, useEffect, useState } from 'react'; import { history, useParams } from '@umijs/max'; -import { Alert, App, Button, Card, Descriptions, Flex, Form, Input, InputNumber, Select, Space, Typography } from 'antd'; +import { Alert, App, Button, Card, Descriptions, Divider, Flex, Form, Input, Select, Space, Typography } from 'antd'; +import { usePageActions, usePageInfo } from '@/components/PageActions'; import { creatorAction, creatorGet, creatorUpdate, getList } from '@/services/api'; import { conflictMessage, dateTime } from '@/utils/helpers'; @@ -30,6 +33,35 @@ export default function Page() { const selected = profiles.find((item) => item.id === selectedID); + // 页头 content 行左侧:实体标识(账号名 + 平台/账号 ID),与详情页同形态。 + usePageInfo( + selected ? ( + + + {selected.name || selected.platform_account_key} + + + {platformLabelMap[selected.platform] || selected.platform} · {selected.platform_account_key} + + + ) : null, + [selected?.id, selected?.name, selected?.platform], + ); + + // 页头 content 行右侧:返回 + 登录操作,不在卡片内重复渲染。 + usePageActions( + + + + + , + [selected?.id, selected?.platform], + ); + const load = useCallback(async () => { setPending(true); setError(null); @@ -121,39 +153,19 @@ export default function Page() { if (!selected) return ; return ( -
-
-
- - {selected.name || selected.platform_account_key} - - - {platformLabelMap[selected.platform] || selected.platform} · {selected.platform_account_key} - -
- -
- - - - - {selected.login_status === 'logged_in' ? '已登录' : '需人工确认'} - {selected.login_checked_at ? ` · ${dateTime(selected.login_checked_at)}` : ' · 尚未核验'} - {selected.login_reason ? ` · ${selected.login_reason}` : ''} - - {selected.password_configured ? '已配置' : '未配置'} - - - - - - + + + + + {selected.login_status === 'logged_in' ? '已登录' : '需人工确认'} + {selected.login_checked_at ? ` · ${dateTime(selected.login_checked_at)}` : ' · 尚未核验'} + {selected.login_reason ? ` · ${selected.login_reason}` : ''} + + {selected.password_configured ? '已配置' : '未配置'} + {loginQR ? ( - 刷新登录画面}> + <> + {loginQR.qr_detected ? '请使用抖音 App 扫描下方二维码。' : '当前画面未检测到二维码,请按画面提示人工完成验证。'} @@ -165,8 +177,10 @@ export default function Page() { 当前画面有效至 {dateTime(loginQR.expires_at)};完成扫码后请点击“核验浏览器身份”。 - + ) : null} + +
@@ -206,14 +220,14 @@ export default function Page() { -
+ 最近更新:{selected.updated_at ? dateTime(selected.updated_at) : '—'} -
+ -
-
+ + ); }