ArtList 底座与安全:接入 Flyway 基线、下线 mock 支付、Redis 会话隔离并清理死代码
This commit is contained in:
@@ -158,9 +158,6 @@ export interface GrowthSummaryVO {
|
||||
export const paymentApi = {
|
||||
prepareOrderPayment: async (orderId: IdType): Promise<PaymentOrderVO> => {
|
||||
return await api.post<PaymentOrderVO>(`/payment/order/${orderId}/prepare`) as unknown as PaymentOrderVO
|
||||
},
|
||||
mockSuccess: async (orderId: IdType): Promise<PaymentOrderVO> => {
|
||||
return await api.post<PaymentOrderVO>(`/payment/order/${orderId}/mock-success`) as unknown as PaymentOrderVO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ const isQuoteConfirming = computed(() => isQuoteStatus(order.value?.status))
|
||||
const statusClass = (status?: number) => isQuoteStatus(status) ? 'quote' : status === 2 ? 'done' : status === 3 ? 'cancelled' : 'pending'
|
||||
const isOrderPaid = (target: any) => String(target?.paymentStatus || '').toUpperCase() === 'PAID'
|
||||
const canPreparePayment = computed(() => !isQuoteConfirming.value && Number(order.value?.status) === 1 && !isOrderPaid(order.value))
|
||||
const canMockPay = computed(() => !isQuoteConfirming.value && Number(order.value?.status) === 1 && String(order.value?.paymentStatus || '').toUpperCase() === 'PAYING')
|
||||
const canApplyAfterSale = computed(() => !isQuoteConfirming.value && (Number(order.value?.status) === 2 || isOrderPaid(order.value)))
|
||||
|
||||
const timeline = computed(() => {
|
||||
@@ -206,15 +205,6 @@ const preparePayment = async () => {
|
||||
message.success('支付单已准备')
|
||||
}
|
||||
|
||||
const mockPay = async () => {
|
||||
if (!order.value?.id) return
|
||||
await runWithGlobalLoading(async () => {
|
||||
await paymentApi.mockSuccess(order.value.id)
|
||||
await loadOrder()
|
||||
})
|
||||
message.success('模拟支付成功')
|
||||
}
|
||||
|
||||
const cancelOrder = () => {
|
||||
if (!order.value?.id) return
|
||||
Modal.confirm({
|
||||
@@ -358,7 +348,6 @@ onMounted(loadOrder)
|
||||
|
||||
<section class="action-bar">
|
||||
<a-button v-if="canPreparePayment" @click="preparePayment">准备支付</a-button>
|
||||
<a-button v-if="canMockPay" type="primary" @click="mockPay">模拟支付</a-button>
|
||||
<a-button v-if="canApplyAfterSale" @click="router.push({ path: '/after-sale/apply', query: { orderId } })">申请售后</a-button>
|
||||
<a-button v-if="order.status === 1" danger @click="cancelOrder">取消订单</a-button>
|
||||
</section>
|
||||
|
||||
@@ -201,7 +201,6 @@
|
||||
<div class="order-card__actions">
|
||||
<button v-if="orderNeedsReview(order)" type="button" class="order-action order-action--primary" @click="openReviewModal(firstPendingReview(order))">去评价</button>
|
||||
<button v-if="canPreparePayment(order)" type="button" class="order-action order-action--primary" @click="preparePayment(order)">立即支付</button>
|
||||
<button v-if="canMockPay(order)" type="button" class="order-action order-action--primary" @click="mockPay(order)">立即支付</button>
|
||||
<button type="button" class="order-action" @click="router.push(`/orders/${order.id}`)">查看详情</button>
|
||||
<button v-if="canApplyAfterSale(order)" type="button" class="order-action" @click="openAfterSaleModal(order)">申请售后</button>
|
||||
<button v-if="hasRebookableItems(order)" type="button" class="order-action order-action--primary" @click="rebookOrder(order)">复刻同款</button>
|
||||
@@ -471,7 +470,6 @@ const orderPaymentStatus = (order: any) => String(order.paymentStatus || order.p
|
||||
const isOrderPaid = (order: any) => orderPaymentStatus(order) === 'PAID'
|
||||
const orderNeedsPayment = (order: any) => Number(order.status) === 1 && !isOrderPaid(order)
|
||||
const canPreparePayment = (order: any) => orderNeedsPayment(order) && orderPaymentStatus(order) !== 'PAYING'
|
||||
const canMockPay = (order: any) => Number(order.status) === 1 && orderPaymentStatus(order) === 'PAYING'
|
||||
const canApplyAfterSale = (order: any) => !isQuoteConfirming(order) && (Number(order.status) === 2 || isOrderPaid(order))
|
||||
|
||||
/**
|
||||
@@ -779,18 +777,6 @@ const preparePayment = async (order: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
const mockPay = async (order: any) => {
|
||||
try {
|
||||
await runWithGlobalLoading(async () => {
|
||||
await paymentApi.mockSuccess(order.id)
|
||||
await loadOrders()
|
||||
})
|
||||
message.success('支付成功')
|
||||
} catch (error: any) {
|
||||
message.error(error?.message || '支付失败')
|
||||
}
|
||||
}
|
||||
|
||||
const submitQuoteReply = async (order: any) => {
|
||||
const key = quoteOrderKey(order)
|
||||
const remark = String(quoteReplyForms[key] || '').trim()
|
||||
|
||||
Reference in New Issue
Block a user