微信登录日志

This commit is contained in:
2026-07-07 17:17:03 +08:00
parent 2c74f6a08c
commit 7e3c0011bb
4 changed files with 146 additions and 17 deletions
@@ -128,4 +128,29 @@ export class WechatLocationService {
return result;
}
async reportChooseImage(input: {
status: 'success' | 'fail';
errMsg?: string;
sourceType?: string;
stage?: string;
pageUrl?: string;
actorRef?: WechatActorRef;
}) {
const logId = await logWechatAuth(this.prisma, {
scene: 'CHOOSE_IMAGE',
requestUrl: input.pageUrl?.split('#')[0]?.slice(0, 512),
requestBody: {
status: input.status,
...(input.sourceType ? { sourceType: input.sourceType } : {}),
...(input.stage ? { stage: input.stage } : {}),
...(input.errMsg ? { errMsg: input.errMsg.slice(0, 200) } : {}),
},
responseBody: { reported: true },
status: input.status === 'success' ? 'SUCCESS' : 'FAILED',
errorMessage: input.status === 'fail' ? input.errMsg?.slice(0, 512) : undefined,
actorRef: input.actorRef,
});
return { ok: true, logId: logId.toString() };
}
}