PDF课件上传

This commit is contained in:
18571350067 2022-03-11 18:15:44 +08:00
parent c6f8452f8d
commit 4b25e1152f
1 changed files with 8 additions and 4 deletions

View File

@ -69,9 +69,9 @@
</div> </div>
<br /> <br />
<div> <div>
<span v-show="this.successOssFile.length < 1">文件上传</span>&nbsp; <a-upload list-type="picture" :default-file-list="this.successOssFile" :beforeUpload="beforeUpload" :remove="deleteVideo" <span v-if="this.successOssFile.length < 1">文件上传</span>&nbsp; <a-upload list-type="picture" accept=".pdf" :default-file-list="this.successOssFile" :beforeUpload="beforeUpload" :remove="deleteVideo"
:disabled="this.uploadLoading"> :disabled="this.uploadLoading">
<a-button v-show="this.successOssFile.length < 1"> <a-button v-if="this.successOssFile.length < 1">
<a-icon type="upload" /> {{this.uploadButtonText}} <a-icon type="upload" /> {{this.uploadButtonText}}
</a-button>&nbsp;&nbsp;&nbsp; </a-button>&nbsp;&nbsp;&nbsp;
</a-upload> </a-upload>
@ -294,7 +294,7 @@ export default {
// //
const data = new FormData(); const data = new FormData();
data.append('file', file); data.append('file', file);
data.append('fileType', 'mp4'); data.append('fileType', this.fileUpload.tabkey == '1' ? 'mp4' : 'pdf');
//token //token
const header = {}; const header = {};
@ -343,7 +343,11 @@ export default {
console.log("进来了!!!!!",err); console.log("进来了!!!!!",err);
// data.delete("file") // // data.delete("file") //
// this.uploadButtonText = ''; // this.uploadButtonText = '';
this.$message.error("上传失败!视频超出可上传大小范围");
for (let i = 0; i < this.successOssFile.length; i++) {
this.deleteVideo(this.successOssFile[i]);
}
this.$message.error("上传失败!"+this.fileUpload.tabkey == '1' ? "视频":"文件"+"超出可上传大小范围或文件已损坏!");
}); });
return false; return false;
}, },