feat(recharge): add full virtual recharge flow for aigc credits
- Replace legacy recharge API endpoints with new dedicated VirtualRechargeApi with sensitive request logging - Implement pending order tracking, automatic payment reconciliation, and recovery for interrupted payments - Overhaul recharge component logic to support both pre-defined package and custom amount recharge - Fix currency price formatting to consistently display 2 decimal places for all monetary values - Remove unused xiaoqi-avatar asset and related component imports - Simplify Vite build asset naming configuration - Switch application to test development mode
This commit is contained in:
@@ -24,14 +24,6 @@ function getCurrentCredit() {
|
||||
return request.get("/hotelBiz/credit/current", {});
|
||||
}
|
||||
|
||||
function getRechargeOptions() {
|
||||
return request.get("/hotelBiz/credit/recharge/options", {});
|
||||
}
|
||||
|
||||
function rechargeCredit(args) {
|
||||
return request.post("/hotelBiz/credit/recharge", args);
|
||||
}
|
||||
|
||||
function getCreditLedgerPage(args) {
|
||||
return request.post("/hotelBiz/credit/ledger/page", args);
|
||||
}
|
||||
@@ -55,8 +47,6 @@ export {
|
||||
getAigcGeneratorTaskDetail,
|
||||
createAigcGeneratorTask,
|
||||
getCurrentCredit,
|
||||
getRechargeOptions,
|
||||
rechargeCredit,
|
||||
getCreditLedgerPage,
|
||||
getPointsTopUpAgreement,
|
||||
createAigcGeneratorTaskShare,
|
||||
|
||||
44
src/request/api/VirtualRechargeApi.js
Normal file
44
src/request/api/VirtualRechargeApi.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from "../base/request";
|
||||
|
||||
const VIRTUAL_RECHARGE_BASE_PATH = "/hotelBiz/credit/virtual-recharge";
|
||||
|
||||
const getVirtualRechargeOrderPath = (rechargeOrderNo) => {
|
||||
const normalizedOrderNo = String(rechargeOrderNo || "").trim();
|
||||
if (!normalizedOrderNo) {
|
||||
throw new Error("积分充值订单号不能为空");
|
||||
}
|
||||
|
||||
return `${VIRTUAL_RECHARGE_BASE_PATH}/orders/${encodeURIComponent(normalizedOrderNo)}`;
|
||||
};
|
||||
|
||||
function getVirtualRechargeOptions() {
|
||||
return request.get(`${VIRTUAL_RECHARGE_BASE_PATH}/options`, {});
|
||||
}
|
||||
|
||||
function createVirtualRechargeOrder(args) {
|
||||
return request.post(`${VIRTUAL_RECHARGE_BASE_PATH}/orders`, args, {
|
||||
sensitive: true,
|
||||
});
|
||||
}
|
||||
|
||||
function confirmVirtualRechargeOrder(rechargeOrderNo, args = {}) {
|
||||
const wxLoginCode = String(args?.wxLoginCode || "").trim();
|
||||
const payload = wxLoginCode ? { wxLoginCode } : {};
|
||||
|
||||
return request.post(
|
||||
`${getVirtualRechargeOrderPath(rechargeOrderNo)}/confirm`,
|
||||
payload,
|
||||
{ sensitive: true }
|
||||
);
|
||||
}
|
||||
|
||||
function getVirtualRechargeOrder(rechargeOrderNo) {
|
||||
return request.get(getVirtualRechargeOrderPath(rechargeOrderNo), {});
|
||||
}
|
||||
|
||||
export {
|
||||
confirmVirtualRechargeOrder,
|
||||
createVirtualRechargeOrder,
|
||||
getVirtualRechargeOptions,
|
||||
getVirtualRechargeOrder,
|
||||
};
|
||||
Reference in New Issue
Block a user