Files
Artveris/packages/shared/src/constants.ts
T
Nixevol f712b16c1f fix: 修复后端竞态/安全/数据处理问题并移除冗余 outImage 列
首次激活改条件更新消除并发竞态;备份恢复补模型全集与版本校验防清库;
审核列表分页总数、操作日志未捕获 Promise、出库导入重复码、加密密钥可编辑、
溯源码盐以 env 为准、证书按 originKey reconcile、env 加载去重等修复;
新增 parseBigId 防非法入参 500、全局安全响应头、去除 SVG 上传、接入 throttler 限流、
入队失败补偿、hashData 稳定序列化、无效码负缓存、看板已激活口径调整;
移除冗余 TraceCode.outImage 列统一 outImages(迁移 drop_trace_code_out_image)。
2026-07-09 13:14:26 +08:00

68 lines
2.0 KiB
TypeScript

export const QUEUE_NAMES = {
GEN_CODE: 'gen-code',
IMPORT_OUTBOUND: 'import-outbound',
IMPORT_OUTBOUND_PREVIEW: 'import-outbound-preview',
WATERMARK: 'watermark',
ONCHAIN: 'onchain',
BACKUP: 'backup',
RESTORE: 'restore',
} as const;
export const SHORT_CODE_LENGTH = 12;
export const TRACE_CODE_PATTERN = /^\d{12}$/;
export const MAX_IMAGE_SIZE = 10 * 1024 * 1024;
export const MAX_VIDEO_SIZE = 100 * 1024 * 1024;
export const MAX_FILE_SIZE = 20 * 1024 * 1024;
// 不允许上传 SVG:SVG 可内嵌脚本,从同源 /uploads 直接打开会造成存储型 XSS。
// 内置默认图标是打包进前端的静态 svg(/admin、/trace 下),不经上传,不受影响。
export const ALLOWED_IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/webp', 'image/gif'];
export const ALLOWED_VIDEO_TYPES = ['video/mp4', 'video/webm', 'video/quicktime'];
export const ALLOWED_DOC_TYPES = ['application/pdf', 'image/jpeg', 'image/png'];
export interface ImportColumn {
key: string;
header: string;
required: boolean;
note: string;
example: string;
}
export const OUTBOUND_IMPORT_COLUMNS: ImportColumn[] = [
{
key: 'shortCode',
header: '追溯码',
required: true,
note: '必填,生码导出文件中的追溯码,定位到具体一件作品。',
example: '482630790612',
},
{
key: 'batchNo',
header: '批次编号',
required: false,
note: '选填,仅作核对;与该码实际批次不符则该行失败。',
example: 'B20240601',
},
{
key: 'outTime',
header: '出库时间',
required: false,
note: '选填,格式 YYYY-MM-DD HH:mm。',
example: '2024-06-01 10:00',
},
{
key: 'outImages',
header: '出库实况图路径',
required: false,
note: '选填,ZIP 内 images 目录下的图片路径,多张用 ; 分隔,如 images/out-001.jpg;images/out-002.png。',
example: 'images/out-001.jpg;images/out-002.png',
},
{
key: 'remark',
header: '备注',
required: false,
note: '选填。',
example: '',
},
];