PDF课件上传
This commit is contained in:
parent
c6f8452f8d
commit
4b25e1152f
|
@ -69,9 +69,9 @@
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div>
|
<div>
|
||||||
<span v-show="this.successOssFile.length < 1">文件上传:</span> <a-upload list-type="picture" :default-file-list="this.successOssFile" :beforeUpload="beforeUpload" :remove="deleteVideo"
|
<span v-if="this.successOssFile.length < 1">文件上传:</span> <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>
|
</a-button>
|
||||||
</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;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue