fix(admin): 统一剧集上传格式与提示文案
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7d39e3c684
commit
c71a12f6f4
5 files changed
+17
-15
No files matched your search
@@ -20,7 +20,7 @@ import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { probeVideoDuration, uploadFile } from '@/utils/uploader'
|
||||
import BatchUploadDialog from './upload/BatchUploadDialog.vue'
|
||||
import { listPendingSessions } from './upload/uploadSessions'
|
||||
import { MAX_VIDEO_SIZE } from './upload/videoLimit'
|
||||
import { MAX_VIDEO_SIZE, VIDEO_ACCEPT_ATTR, VIDEO_EXTENSIONS } from './upload/videoLimit'
|
||||
|
||||
const route = useRoute()
|
||||
const { can } = useRbac()
|
||||
@@ -62,7 +62,6 @@ const statusOptions = [
|
||||
{ code: 'offline', text: '已下线' }
|
||||
]
|
||||
|
||||
const VIDEO_EXTENSIONS = ['mp4', 'mov']
|
||||
const formRules = {
|
||||
number: [{ required: true, message: '请输入集号', trigger: 'change' }],
|
||||
title: [{ required: true, message: '请输入剧集标题', trigger: 'blur' }],
|
||||
@@ -218,7 +217,7 @@ function beforeVideoUpload(file) {
|
||||
.pop()
|
||||
?.toLowerCase()
|
||||
if (!VIDEO_EXTENSIONS.includes(extension)) {
|
||||
videoError.value = '视频仅支持 MP4 或 MOV 格式'
|
||||
videoError.value = t('episodeBatch.invalidType')
|
||||
return false
|
||||
}
|
||||
if (file.size > MAX_VIDEO_SIZE) {
|
||||
@@ -556,7 +555,7 @@ onMounted(async () => {
|
||||
drag
|
||||
class="episode-video-empty-upload"
|
||||
:show-file-list="false"
|
||||
accept=".mp4,.mov"
|
||||
:accept="VIDEO_ACCEPT_ATTR"
|
||||
:before-upload="beforeVideoUpload"
|
||||
:http-request="uploadVideo"
|
||||
:disabled="uploadingVideo"
|
||||
@@ -564,7 +563,7 @@ onMounted(async () => {
|
||||
<div class="episode-video-empty-copy">
|
||||
<AppIcon :icon="AppIcons.videoCameraFront" :size="30" />
|
||||
<b>拖放或点击上传</b>
|
||||
<span>MP4、MOV</span>
|
||||
<span>MP4、MOV、MKV、WEBM</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div v-if="uploadingVideo" class="episode-video-upload-mask">
|
||||
@@ -582,7 +581,7 @@ onMounted(async () => {
|
||||
{{ videoDisplayName }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="episode-video-hint">支持 MP4、MOV,单个文件不超过 500MB。</p>
|
||||
<p class="episode-video-hint">{{ t('episodeBatch.hint') }}</p>
|
||||
<el-alert
|
||||
v-if="videoError"
|
||||
:title="videoError"
|
||||
@@ -594,7 +593,7 @@ onMounted(async () => {
|
||||
<el-upload
|
||||
v-if="form.videoUrl"
|
||||
:show-file-list="false"
|
||||
accept=".mp4,.mov"
|
||||
:accept="VIDEO_ACCEPT_ATTR"
|
||||
:before-upload="beforeVideoUpload"
|
||||
:http-request="uploadVideo"
|
||||
:disabled="uploadingVideo"
|
||||
|
||||
Reference in new issue
Block a user