fix: 收口模板契约与安全门禁

统一模板包 visual 契约并补齐完成证据;修复 release 版本一致性、管理员 token 撤销、CORS 与默认品牌配置;收敛依赖安全风险并完成全量回归验证。
This commit is contained in:
que01 committed 2026-10-18 22:05:31 +08:00
1 parent 456171aa85
commit 4f0b50c7f1
84 files changed
+7367 -5180

No files matched your search

@@ -1,14 +1,16 @@
import { Injectable, NotFoundException } from "@nestjs/common";
import { Injectable, NotFoundException, ServiceUnavailableException } from "@nestjs/common";
import { PrismaService } from "../../prisma.service.js";
const FALLBACK_BRAND_ID = "00000000-0000-0000-0000-000000000001";
@Injectable()
export class PublicBrandContextService {
constructor(private readonly prisma: PrismaService) {}
async resolveId(brandSlug?: string): Promise<string> {
if (!brandSlug) return process.env.DEFAULT_BRAND_ID ?? FALLBACK_BRAND_ID;
if (!brandSlug) {
const defaultBrandId = process.env.DEFAULT_BRAND_ID;
if (!defaultBrandId) throw new ServiceUnavailableException("默认品牌未配置");
return defaultBrandId;
}
const brand = await this.prisma.brandProfile.findUnique({
where: { slug: brandSlug },
select: { id: true },
@@ -1,11 +1,4 @@
import {
BadRequestException,
Controller,
Get,
NotFoundException,
Param,
Query,
} from "@nestjs/common";
import { Controller, Get, NotFoundException, Param, Query } from "@nestjs/common";
import { PublicBrandContextService } from "./public-brand-context.service.js";
import { BrandReleaseService } from "../../brand-release.service.js";