私域操盘手 - 修复微信号详情进入设备详情传参错误的问题
This commit is contained in:
@@ -140,6 +140,7 @@ export default function WechatAccountDetailPage({ params }: { params: { id: stri
|
||||
status: "normal" | "abnormal";
|
||||
wechatId: string;
|
||||
deviceName: string;
|
||||
deviceId?: string | number;
|
||||
} | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -594,9 +595,19 @@ export default function WechatAccountDetailPage({ params }: { params: { id: stri
|
||||
</div>
|
||||
<p className="text-sm text-gray-500 mt-1">微信号:{account.wechatId}</p>
|
||||
<div className="flex gap-2 mt-2">
|
||||
<Button variant="outline" onClick={() => router.push(`/devices/${account.deviceId}`)}>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => {
|
||||
// 优先使用 initialData.deviceId
|
||||
const targetDeviceId = initialData?.deviceId || account.deviceId;
|
||||
if (targetDeviceId) {
|
||||
// 保证 deviceId 是数字或字符串
|
||||
return router.push(`/devices/${targetDeviceId}`);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Smartphone className="w-4 h-4 mr-2" />
|
||||
{account.deviceName}
|
||||
{account.deviceName || '未命名设备'}
|
||||
</Button>
|
||||
<Button variant="outline" onClick={handleTransferFriends}>
|
||||
<UserPlus className="w-4 h-4 mr-2" />
|
||||
|
||||
@@ -76,7 +76,7 @@ export default function WechatAccountsPage() {
|
||||
deviceName: item.deviceMemo,
|
||||
lastActive: item.activeTime,
|
||||
maxDailyAdds: item.times,
|
||||
deviceId: item.id.toString(),
|
||||
deviceId: item.deviceId.toString(),
|
||||
};
|
||||
return account;
|
||||
});
|
||||
@@ -264,6 +264,7 @@ export default function WechatAccountsPage() {
|
||||
status: account.status,
|
||||
wechatId: account.wechatId,
|
||||
deviceName: account.deviceName,
|
||||
deviceId: account.deviceId,
|
||||
}));
|
||||
router.push(`/wechat-accounts/${account.id}?data=${accountData}`);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user