feat: 支持公开品牌 slug 解析

This commit is contained in:
que01 committed 2026-09-23 03:12:08 +08:00
1 parent e89b751572
commit ff5dc4e3ba
5 files changed
+13 -2

No files matched your search

+6 -2
View File
@@ -148,8 +148,12 @@ export class PublicTemplateController {
export class PublicWorkspaceController {
constructor(private readonly prisma: PrismaService) {}
@Get()
async get(): Promise<unknown> {
const brandId = process.env.DEFAULT_BRAND_ID ?? "00000000-0000-0000-0000-000000000001";
async get(@Query("brandSlug") brandSlug?: string): Promise<unknown> {
const configuredId = process.env.DEFAULT_BRAND_ID ?? "00000000-0000-0000-0000-000000000001";
const selected = brandSlug
? await this.prisma.brandProfile.findUnique({ where: { slug: brandSlug }, select: { id: true } })
: null;
const brandId = selected?.id ?? configuredId;
const [
brand,
modules,