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:
@@ -14,6 +14,8 @@ const defaultConfig = {
|
||||
};
|
||||
|
||||
function request(url, args = {}, method = "POST", customConfig = {}) {
|
||||
const { sensitive = false, ...requestCustomConfig } = customConfig;
|
||||
customConfig = requestCustomConfig;
|
||||
const appStore = useAppStore();
|
||||
// 判断 url 是否以 http 开头
|
||||
if (!/^http/.test(url)) {
|
||||
@@ -53,7 +55,11 @@ function request(url, args = {}, method = "POST", customConfig = {}) {
|
||||
header,
|
||||
};
|
||||
|
||||
console.log(`\n\n请求接口: ${url}, \n请求参数: ${JSON.stringify(args)}, \n请求头: ${JSON.stringify(config)}\n\n`);
|
||||
if (sensitive) {
|
||||
console.log(`\n\n请求接口: ${url}, \n敏感请求参数和请求头已隐藏\n\n`);
|
||||
} else {
|
||||
console.log(`\n\n请求接口: ${url}, \n请求参数: ${JSON.stringify(args)}, \n请求头: ${JSON.stringify(config)}\n\n`);
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
@@ -62,7 +68,11 @@ function request(url, args = {}, method = "POST", customConfig = {}) {
|
||||
method,
|
||||
...config,
|
||||
success: (res) => {
|
||||
console.log(`\n\n请求接口: ${url}, \n请求响应: ${JSON.stringify(res)}, \n\n`);
|
||||
if (sensitive) {
|
||||
console.log(`\n\n请求接口: ${url}, \n响应状态: ${res.statusCode || "unknown"}\n\n`);
|
||||
} else {
|
||||
console.log(`\n\n请求接口: ${url}, \n请求响应: ${JSON.stringify(res)}, \n\n`);
|
||||
}
|
||||
|
||||
resolve(res.data);
|
||||
if (res.statusCode && res.statusCode === 424) {
|
||||
|
||||
Reference in New Issue
Block a user