交付仅接收上架成品

This commit is contained in:
WuYongJie 2026-11-30 21:10:31 +08:00
parent 71eecd09d6
commit 835ad8a89f

View File

@ -60,8 +60,10 @@ function normalized(input: Input) {
desktopAssert(new Set(files.map(file => file.group + '\\0' + file.fileName)).size === files.length, '同一分组中有重名文件,请调整名称')
if (input.kind === 'detail') {
desktopAssert(['main','sku','detail'].every(group => files.some(file => file.group === group)), '详情三件套需要主图、SKU 和详情图')
desktopAssert(files.every(file => file.group !== 'source' && /\.(?:jpe?g|png|webp)$/i.test(file.fileName)), '详情三件套只接收主图、SKU 和详情成品图')
} else {
desktopAssert(files.every(file => file.group === input.kind), '该交付类型只接收对应的结果文件')
desktopAssert(files.every(file => !/\.(?:psd|psb|pcraft)$/i.test(file.fileName)), '只接收成品文件,不接收源文件')
}
const identity = { projectId, requestId: input.requestId, kind: input.kind, productModel, categoryName, productCategoryName, brandName, productName, identifierType,
files: files.map(({group,fileName,fileSize,sha256}) => ({group,fileName,fileSize,sha256})) }