|
@@ -24,6 +24,7 @@ import {
|
|
|
// 使用RPC方式提取类型
|
|
// 使用RPC方式提取类型
|
|
|
type Passenger = InferResponseType<typeof passengerClient.$get, 200>['data'][0]
|
|
type Passenger = InferResponseType<typeof passengerClient.$get, 200>['data'][0]
|
|
|
type OrderCreateRequest = InferRequestType<typeof orderClient.$post>['json']
|
|
type OrderCreateRequest = InferRequestType<typeof orderClient.$post>['json']
|
|
|
|
|
+type PaymentResponse = InferResponseType<typeof paymentClient.$post, 200>
|
|
|
|
|
|
|
|
// 模拟数据 - 待替换为真实API
|
|
// 模拟数据 - 待替换为真实API
|
|
|
export default function OrderPage() {
|
|
export default function OrderPage() {
|
|
@@ -227,7 +228,7 @@ export default function OrderPage() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 调用微信支付
|
|
// 调用微信支付
|
|
|
- const handleWechatPayment = async (paymentData: any, orderId: number, amount: number) => {
|
|
|
|
|
|
|
+ const handleWechatPayment = async (paymentData: PaymentResponse, orderId: number, amount: number) => {
|
|
|
const stateManager = PaymentStateManager.getInstance()
|
|
const stateManager = PaymentStateManager.getInstance()
|
|
|
const rateLimiter = PaymentRateLimiter.getInstance()
|
|
const rateLimiter = PaymentRateLimiter.getInstance()
|
|
|
|
|
|
|
@@ -393,6 +394,7 @@ export default function OrderPage() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 调用微信支付
|
|
// 调用微信支付
|
|
|
|
|
+ console.log('支付参数:', paymentResult)
|
|
|
const wechatPaymentResult = await handleWechatPayment(paymentResult, order.id, totalPrice)
|
|
const wechatPaymentResult = await handleWechatPayment(paymentResult, order.id, totalPrice)
|
|
|
|
|
|
|
|
if (wechatPaymentResult.success) {
|
|
if (wechatPaymentResult.success) {
|