fix: 固定默认品牌解析避免多品牌串线
This commit is contained in:
1 parent
045472035b
commit
cbe9d26288
4 files changed
+58
-2
No files matched your search
@@ -15,7 +15,10 @@ export class CustomerSessionController {
|
||||
@Post("wechat")
|
||||
async wechatLogin(@Body() body: WechatLoginDto): Promise<{ token: string }> {
|
||||
const session = await this.wechatAuth.exchangeCode(body.code);
|
||||
const brand = await this.prisma.brandProfile.findFirst({ select: { id: true } });
|
||||
const brand = await this.prisma.brandProfile.findUnique({
|
||||
where: { id: process.env.DEFAULT_BRAND_ID ?? "00000000-0000-0000-0000-000000000001" },
|
||||
select: { id: true },
|
||||
});
|
||||
if (!brand) throw new BadRequestException("品牌尚未初始化");
|
||||
await this.prisma.customerUser.upsert({
|
||||
where: { brandId_openid: { brandId: brand.id, openid: session.openid } },
|
||||
|
||||
Reference in new issue
Block a user