修复镜像订单重试与级联配置可见性一致性
This commit is contained in:
1 parent
4bc84717ff
commit
695bc9192f
3 files changed
+497
-47
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
// 付费镜像授权弹窗:复查实时价格、复用本组件已建订单,并在支付后重新检查授权。
|
||||
// 付费镜像授权弹窗:复查实时价格和已建订单状态,并在支付后重新检查授权。
|
||||
import "~/assets/styles/PaymentDialog.BNFKQF1U.css";
|
||||
import { toDisplayString } from "vue";
|
||||
import { onBeforeUnmount } from "vue";
|
||||
@@ -73,7 +73,7 @@ var C = {
|
||||
if (!n()) return;
|
||||
let r = F(t.price);
|
||||
if (Number(r) === 0) {
|
||||
((w.value = null), T(`authorized`));
|
||||
(j.delete(P(e)), (w.value = null), T(`authorized`));
|
||||
return;
|
||||
}
|
||||
if (r !== F(e.price)) {
|
||||
@@ -85,6 +85,21 @@ var C = {
|
||||
return;
|
||||
}
|
||||
let i = j.get(P(e));
|
||||
if (i) {
|
||||
// 订单可在其他标签页取消;缓存只负责去重,是否可复用必须以服务端状态为准。
|
||||
let { order } = await E.get(`/order/${i}`);
|
||||
if (!n()) return;
|
||||
if (!order || String(order.id) !== String(i))
|
||||
throw Error(`镜像订单信息无效,请稍后重试`);
|
||||
if (order.status === `Cancelled`) {
|
||||
j.delete(P(e));
|
||||
i = null;
|
||||
} else if (order.status === `Paid`)
|
||||
// 已付款不等于授权已同步,不能因授权延迟再创建一张收费订单。
|
||||
throw Error(`镜像订单已支付,授权尚未生效,请稍后重新检查`);
|
||||
else if (order.status !== `Unpaid`)
|
||||
throw Error(`当前镜像订单状态不支持支付,请稍后重试`);
|
||||
}
|
||||
if (!i) {
|
||||
let t = await E.post(`/${e.module}/${e.hostId}/image/order`, {
|
||||
image_id: e.imageId,
|
||||
|
||||
Reference in new issue
Block a user