feat(semi-auto): 客户链接按平台严格绑定,注入后统一由前端打开指定页

This commit is contained in:
2026-11-17 17:27:19 +08:00
parent 7bd5b8bade
commit 77e1c69a2b
13 changed files with 459 additions and 56 deletions
@@ -33,6 +33,7 @@ import {
type DevMockSemiAutoResult,
type DevSemiAutoIntegrationResult,
} from '@/services/admin'
import { buildCustomerFulfillmentPath } from '@/utils/customer-fulfillment-link'
export default function AdminDevMockPage() {
const { message } = App.useApp()
@@ -109,6 +110,14 @@ export default function AdminDevMockPage() {
})
const defaultOrderNo = useMemo(() => lastCreate?.orderNo || '', [lastCreate?.orderNo])
// 页面展示按平台重新生成规范路径,避免历史 Mock 响应里的 customerPath 仍是 /c。
const semiAutoCustomerPath = lastSemiAuto
? buildCustomerFulfillmentPath(lastSemiAuto.orderNo, lastSemiAuto.semiAutoPlatform) ||
lastSemiAuto.customerPath
: ''
const semiAutoCustomerUrl = semiAutoCustomerPath
? `${window.location.origin}${semiAutoCustomerPath}`
: ''
if (statusQuery.isLoading) {
return (
@@ -347,32 +356,22 @@ export default function AdminDevMockPage() {
<Col span={24}>
<Typography.Text type="secondary">客户履约入口</Typography.Text>
<div>
<Typography.Link
href={`${window.location.origin}${lastSemiAuto.customerPath}`}
target="_blank"
rel="noreferrer"
>
<Typography.Link href={semiAutoCustomerUrl} target="_blank" rel="noreferrer">
<LinkOutlined /> {window.location.origin}
{lastSemiAuto.customerPath}
{semiAutoCustomerPath}
</Typography.Link>
</div>
<Space style={{ marginTop: 8 }} wrap>
<Button
icon={<CopyOutlined />}
onClick={async () => {
await navigator.clipboard.writeText(
`${window.location.origin}${lastSemiAuto.customerPath}`,
)
await navigator.clipboard.writeText(semiAutoCustomerUrl)
message.success('已复制客户履约链接')
}}
>
复制客户链接
</Button>
<Button
type="primary"
href={`${window.location.origin}${lastSemiAuto.customerPath}`}
target="_blank"
>
<Button type="primary" href={semiAutoCustomerUrl} target="_blank">
打开客户页
</Button>
</Space>