fix(ads): 终审修复——staging 前缀+运行时上限核验/失效绑定编辑/白名单去 heic/杂项
- verifyStaging 硬化(services/api/src/ads/ads.service.ts):新增键前缀核验 (仅 OBJECT_KEY_ROOT/ads/staging/ 布局,防照片域任意键被提升为公开广告) 与运行时 2MB 上限(head.bytes > AD_UPLOAD_MAX_BYTES → 400 报文含限额值 ——init 申明管不住实际 PUT 体,create/update 是唯一核验点);e2e ⑰ 以 测试 storage 直接 presignPut 真实对象覆盖两分支 - 失效绑定编辑 400(admin AdsFormDialog):PATCH 仅在 albumIds 实际变化时 携带(albumIdsChanged 序敏感深比较,纯函数落 adsLogic + vitest 用例); preloadOptions 解析失败的绑定 ID 加「已失效,可移除」后缀(zh/en 新增 adsManage.form.staleAlbum)——软删绑定不再挡住其它字段保存 - 白名单去 heic(原图直出无变体兜底,Chromium/Firefox 不渲染=破图): contracts 三处 enum 收窄 [image/jpeg, image/png] 并重生成类型;dto 定义 广告域独立 AD_IMAGE_CONTENT_TYPES(与照片域 UPLOAD_CONTENT_TYPES 分离), AD_IMAGE_EXTENSIONS 由其派生;init 对 .heic 文件名以广告域集合二次核验 拒绝(共享 extOfFilename 仍认 heic,杜绝 init 放行→create 中段断裂); e2e heic 矩阵 400;admin accept/文案/类型同步收窄 - searchAlbums 补 catch(http 层已弹 toast,本地静默保持旧选项) - ActivityPage 关闭记忆测试补位(activity.spec):dismissed 不拉取不渲染、 close 写 sessionStorage 并清空轮播两用例(getPublicAds 入替身防真实 fetch) Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -4860,8 +4860,8 @@ components:
|
||||
description: 申明字节数(须与 staging 对象一致;上限 AD_UPLOAD_MAX_BYTES=2MB)。
|
||||
imageContentType:
|
||||
type: string
|
||||
enum: [image/jpeg, image/png, image/heic]
|
||||
description: 申明类型(须与 staging 对象一致);image/heic 为暂定项,解码能力待 G2 真机验证后确认。
|
||||
enum: [image/jpeg, image/png]
|
||||
description: 申明类型(须与 staging 对象一致);heic 除外:广告无变体流水线、原图直出,桌面浏览器(Chromium/Firefox)不渲染。
|
||||
sortOrder:
|
||||
type: integer
|
||||
minimum: 0
|
||||
@@ -4913,8 +4913,8 @@ components:
|
||||
description: 换图申明字节数(上限 AD_UPLOAD_MAX_BYTES=2MB)。
|
||||
imageContentType:
|
||||
type: string
|
||||
enum: [image/jpeg, image/png, image/heic]
|
||||
description: 换图申明类型。
|
||||
enum: [image/jpeg, image/png]
|
||||
description: 换图申明类型;heic 除外(同 AdCreateRequest.imageContentType:广告无变体流水线,桌面浏览器不渲染)。
|
||||
|
||||
AdUploadInitRequest:
|
||||
type: object
|
||||
@@ -4932,8 +4932,8 @@ components:
|
||||
description: 申明字节数(上限 AD_UPLOAD_MAX_BYTES=2MB,超限 400)。
|
||||
contentType:
|
||||
type: string
|
||||
enum: [image/jpeg, image/png, image/heic]
|
||||
description: MIME 类型白名单;image/heic 为暂定项,解码能力待 G2 真机验证后确认。
|
||||
enum: [image/jpeg, image/png]
|
||||
description: MIME 类型白名单;heic 除外:广告无变体流水线、原图直出,桌面浏览器(Chromium/Firefox)不渲染。
|
||||
|
||||
AdUploadInitResponse:
|
||||
type: object
|
||||
|
||||
+6
-6
@@ -2479,10 +2479,10 @@ export interface components {
|
||||
/** @description 申明字节数(须与 staging 对象一致;上限 AD_UPLOAD_MAX_BYTES=2MB)。 */
|
||||
imageBytes: number;
|
||||
/**
|
||||
* @description 申明类型(须与 staging 对象一致);image/heic 为暂定项,解码能力待 G2 真机验证后确认。
|
||||
* @description 申明类型(须与 staging 对象一致);heic 除外:广告无变体流水线、原图直出,桌面浏览器(Chromium/Firefox)不渲染。
|
||||
* @enum {string}
|
||||
*/
|
||||
imageContentType: "image/jpeg" | "image/png" | "image/heic";
|
||||
imageContentType: "image/jpeg" | "image/png";
|
||||
/** @description 排序权重(缺省 0)。 */
|
||||
sortOrder?: number;
|
||||
/** @description 绑定相册 ID 列表;未提供或空=全局。 */
|
||||
@@ -2510,10 +2510,10 @@ export interface components {
|
||||
/** @description 换图申明字节数(上限 AD_UPLOAD_MAX_BYTES=2MB)。 */
|
||||
imageBytes?: number;
|
||||
/**
|
||||
* @description 换图申明类型。
|
||||
* @description 换图申明类型;heic 除外(同 AdCreateRequest.imageContentType:广告无变体流水线,桌面浏览器不渲染)。
|
||||
* @enum {string}
|
||||
*/
|
||||
imageContentType?: "image/jpeg" | "image/png" | "image/heic";
|
||||
imageContentType?: "image/jpeg" | "image/png";
|
||||
};
|
||||
/** @description 广告图直传初始化请求(无会话概念,幂等由创建端 copyIfAbsent 承担)。 */
|
||||
AdUploadInitRequest: {
|
||||
@@ -2522,10 +2522,10 @@ export interface components {
|
||||
/** @description 申明字节数(上限 AD_UPLOAD_MAX_BYTES=2MB,超限 400)。 */
|
||||
bytes: number;
|
||||
/**
|
||||
* @description MIME 类型白名单;image/heic 为暂定项,解码能力待 G2 真机验证后确认。
|
||||
* @description MIME 类型白名单;heic 除外:广告无变体流水线、原图直出,桌面浏览器(Chromium/Firefox)不渲染。
|
||||
* @enum {string}
|
||||
*/
|
||||
contentType: "image/jpeg" | "image/png" | "image/heic";
|
||||
contentType: "image/jpeg" | "image/png";
|
||||
};
|
||||
AdUploadInitResponse: {
|
||||
/** @description staging 键 photo-live/{env}/ads/staging/{cuid}.{ext}(创建/更新时引用)。 */
|
||||
|
||||
Reference in New Issue
Block a user