日志控制

This commit is contained in:
chen wei bo
2025-09-21 20:18:30 +08:00
parent 23c038fd14
commit 8f90c1d7cf
23 changed files with 207 additions and 178 deletions
@@ -4,6 +4,7 @@
*/
import { PaymentApi } from "./PaymentApi";
import proto from 'db://assets/Scripts/proto/proto.pb.js';
import { logger } from "db://assets/Scripts/Main/Common/Logger";
export interface PollOptions {
maxDurationMs: number; // 最大轮询时长(超过就自动退出)(例如 2分钟)
@@ -41,9 +42,9 @@ export class PaymentPoller {
this.currentPollCount++;
// 查询
let reqData = {orderId: orderId};
console.log("订单:", orderId, " ,第 ", this.currentPollCount, " 次轮询订单的请求数据:", reqData);
logger.log("订单:", orderId, " ,第 ", this.currentPollCount, " 次轮询订单的请求数据:", reqData);
const r = await PaymentApi.I.queryOrder(reqData);
console.log("订单:", orderId, " ,第 ", this.currentPollCount, " 次轮询订单的响应数据:", r);
logger.log("订单:", orderId, " ,第 ", this.currentPollCount, " 次轮询订单的响应数据:", r);
if (r.code === proto.cs.EnmRetCode.SUCCESS && r.data) {
// 回调
onTick?.(r.data);