fix: 修复微信支付 Native/H5 判断逻辑,改为前端设备检测驱动
- 修复 clientIp 始终存在导致永远走 H5 的 bug,改用 isMobile 判断 - 前端通过 detectDeviceIsMobile() 传 is_mobile 给后端 - ENABLED_PAYMENT_TYPES 默认改为空,必须显式配置才启用 - 补充 .env.example 配置说明
This commit is contained in:
@@ -16,6 +16,7 @@ export interface CreateOrderInput {
|
||||
amount: number;
|
||||
paymentType: PaymentType;
|
||||
clientIp: string;
|
||||
isMobile?: boolean;
|
||||
srcHost?: string;
|
||||
srcUrl?: string;
|
||||
}
|
||||
@@ -144,6 +145,7 @@ export async function createOrder(input: CreateOrderInput): Promise<CreateOrderR
|
||||
notifyUrl,
|
||||
returnUrl,
|
||||
clientIp: input.clientIp,
|
||||
isMobile: input.isMobile,
|
||||
});
|
||||
|
||||
await prisma.order.update({
|
||||
|
||||
Reference in New Issue
Block a user