修复合伙人端上传门头照片失败的问题
This commit is contained in:
@@ -24,18 +24,24 @@ type LogOssUploadInput = {
|
||||
};
|
||||
|
||||
export async function logOssUpload(prisma: PrismaService, input: LogOssUploadInput) {
|
||||
const row = await prisma.logThirdParty.create({
|
||||
data: {
|
||||
provider: 'ALIYUN_OSS',
|
||||
scene: input.scene,
|
||||
refType: input.actorRef?.refType,
|
||||
refId: input.actorRef?.refId,
|
||||
requestBody: input.requestBody as never,
|
||||
responseBody: input.responseBody as never,
|
||||
externalNo: input.externalNo?.slice(0, 128),
|
||||
status: input.status,
|
||||
errorMessage: input.errorMessage?.slice(0, 512),
|
||||
},
|
||||
});
|
||||
return row.id;
|
||||
try {
|
||||
const row = await prisma.logThirdParty.create({
|
||||
data: {
|
||||
provider: 'ALIYUN_OSS',
|
||||
scene: input.scene,
|
||||
refType: input.actorRef?.refType,
|
||||
refId: input.actorRef?.refId,
|
||||
requestBody: input.requestBody as never,
|
||||
responseBody: input.responseBody as never,
|
||||
externalNo: input.externalNo?.slice(0, 128),
|
||||
status: input.status,
|
||||
errorMessage: input.errorMessage?.slice(0, 512),
|
||||
},
|
||||
});
|
||||
return row.id;
|
||||
} catch (err) {
|
||||
// 日志表/枚举未就绪时不阻断上传主流程
|
||||
console.error('[oss-upload-log] write failed:', err instanceof Error ? err.message : err);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,13 +86,9 @@ export class WechatController {
|
||||
private normalizeJssdkUrl(rawUrl: string): string {
|
||||
try {
|
||||
const parsed = new URL(rawUrl);
|
||||
parsed.hash = '';
|
||||
parsed.searchParams.delete('code');
|
||||
parsed.searchParams.delete('state');
|
||||
const query = parsed.searchParams.toString();
|
||||
return `${parsed.origin}${parsed.pathname}${query ? `?${query}` : ''}`;
|
||||
return `${parsed.origin}${parsed.pathname}`;
|
||||
} catch {
|
||||
return rawUrl;
|
||||
return rawUrl.split('#')[0].split('?')[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user