feat(upload): 封面上传支持横版与前端压缩
- 新增 imageCompress 与 imagePresets,上传前按规格高质量等比压缩 - 短剧封面拆分为竖版/横版两个上传位,带建议尺寸提示 - 轮播图、创作者中心封面与分集封面接入压缩与提示
This commit is contained in:
1 parent
dea414739e
commit
923b7dce1e
9 files changed
+486
-87
No files matched your search
@@ -18,6 +18,11 @@ import {
|
||||
} from '@/api/admin/creatorCenter'
|
||||
import { dateCell } from '@/utils/format'
|
||||
import { probeVideoDuration, resumeUpload, uploadFile } from '@/utils/uploader'
|
||||
import {
|
||||
DRAMA_COVER_PORTRAIT,
|
||||
EPISODE_COVER,
|
||||
compressForPreset
|
||||
} from '@/views/contentManagement/upload/imagePresets'
|
||||
import { submissionStatusMeta, submissionTypeText, submitOptions } from './useCreatorWorkspace'
|
||||
import { useCreatorAccess } from './useCreatorAccess'
|
||||
|
||||
@@ -266,7 +271,9 @@ export function useDramaEdit() {
|
||||
uploadingId.value = row ? row.id : -1
|
||||
uploadPercent.value = 0
|
||||
try {
|
||||
const asset = await uploadFile(file, {
|
||||
const preset = row ? EPISODE_COVER : DRAMA_COVER_PORTRAIT
|
||||
const compressed = await compressForPreset(file, preset)
|
||||
const asset = await uploadFile(compressed, {
|
||||
bizType: 'DRAMA_COVER',
|
||||
onProgress: (percent) => (uploadPercent.value = percent)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user