|
@@ -44,7 +44,7 @@
|
|
|
<!-- status="success">-->
|
|
<!-- status="success">-->
|
|
|
<!-- </el-progress>-->
|
|
<!-- </el-progress>-->
|
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
|
- <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过500M</div>
|
|
|
|
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过800M</div>
|
|
|
<!-- </el-upload>-->
|
|
<!-- </el-upload>-->
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -277,6 +277,14 @@ export default {
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
handleChange(file, fileList) {
|
|
handleChange(file, fileList) {
|
|
|
|
|
+ const MAX_SIZE = 800 * 1024 * 1024;
|
|
|
|
|
+ if (file.raw && file.raw.size > MAX_SIZE) {
|
|
|
|
|
+ this.$message.error("文件大小不能超过800M");
|
|
|
|
|
+ this.$refs.upload?.clearFiles();
|
|
|
|
|
+ this.fileList = [];
|
|
|
|
|
+ this.$emit("update:fileSize", null);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.fileList = fileList;
|
|
this.fileList = fileList;
|
|
|
this.getVideoDuration(file.raw);
|
|
this.getVideoDuration(file.raw);
|
|
|
},
|
|
},
|
|
@@ -297,6 +305,10 @@ export default {
|
|
|
if (this.fileList.length < 1) {
|
|
if (this.fileList.length < 1) {
|
|
|
return this.$message.error("请先选取视频,再进行上传");
|
|
return this.$message.error("请先选取视频,再进行上传");
|
|
|
}
|
|
}
|
|
|
|
|
+ const MAX_SIZE = 800 * 1024 * 1024;
|
|
|
|
|
+ if (this.fileList[0].raw && this.fileList[0].raw.size > MAX_SIZE) {
|
|
|
|
|
+ return this.$message.error("文件大小不能超过800M");
|
|
|
|
|
+ }
|
|
|
//同时上传个线路
|
|
//同时上传个线路
|
|
|
await this.uploadVideoToTxPcdn();
|
|
await this.uploadVideoToTxPcdn();
|
|
|
this.$emit("update:fileName", this.fileList[0].name);
|
|
this.$emit("update:fileName", this.fileList[0].name);
|
|
@@ -321,6 +333,11 @@ export default {
|
|
|
async uploadVideoToTxPcdn() {
|
|
async uploadVideoToTxPcdn() {
|
|
|
try {
|
|
try {
|
|
|
const file = this.fileList[0].raw;
|
|
const file = this.fileList[0].raw;
|
|
|
|
|
+ const MAX_SIZE = 800 * 1024 * 1024;
|
|
|
|
|
+ if (file && file.size > MAX_SIZE) {
|
|
|
|
|
+ this.$message.error("文件大小不能超过800M");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const data = await uploadObject(file, this.updateTxProgress,this.type);
|
|
const data = await uploadObject(file, this.updateTxProgress,this.type);
|
|
|
console.log("腾讯COS返回========>",data);
|
|
console.log("腾讯COS返回========>",data);
|
|
|
console.log("isPrivate=======>",this.isPrivate)
|
|
console.log("isPrivate=======>",this.isPrivate)
|