|
@@ -524,13 +524,13 @@ export default {
|
|
|
let that = this;
|
|
|
let file = fileData.file;
|
|
|
|
|
|
- // var index = file.name.indexOf("."); //(考虑严谨用lastIndexOf(".")得到)得到"."在第几位
|
|
|
- // var subfix = file.name.substring(index); //截断"."之前的,得到后缀
|
|
|
- // if (subfix != ".mp4") {
|
|
|
- // fileData.onError();
|
|
|
- // this.$message.error("只能上传mp4格式的文件");
|
|
|
- // return;
|
|
|
- // }
|
|
|
+ // var index = file.name.indexOf("."); //(考虑严谨用lastIndexOf(".")得到)得到"."在第几位
|
|
|
+ // var subfix = file.name.substring(index); //截断"."之前的,得到后缀
|
|
|
+ // if (subfix != ".mp4") {
|
|
|
+ // fileData.onError();
|
|
|
+ // this.$message.error("只能上传mp4格式的文件");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
let bucket = "jtxt-file-public";
|
|
|
let ossPath = "file/";
|
|
@@ -584,13 +584,15 @@ export default {
|
|
|
client.multipartUpload(ossPath + fileName, file, options).then(res => {
|
|
|
console.log("---upload-end--" + new Date().getTime());
|
|
|
console.log(res);
|
|
|
+ let fileUrl = res.res.requestUrls[0].split("?")[0];
|
|
|
+ console.log(fileUrl);
|
|
|
let upFile = {
|
|
|
uid: this.getUid(),
|
|
|
name: fileName,
|
|
|
status: "done",
|
|
|
- url: res.url
|
|
|
+ url: fileUrl
|
|
|
};
|
|
|
- that.videoUrl = res.url;
|
|
|
+ that.videoUrl = fileUrl;
|
|
|
that.defaultVideoFileList.push(upFile);
|
|
|
// this.findvideocover(file);
|
|
|
fileData.onSuccess();
|
|
@@ -635,13 +637,15 @@ export default {
|
|
|
try {
|
|
|
client.multipartUpload(ossPath + fileName, file, options).then(res => {
|
|
|
console.log(res);
|
|
|
+ let fileUrl = res.res.requestUrls[0].split("?")[0];
|
|
|
+ console.log(fileUrl);
|
|
|
let upFile = {
|
|
|
uid: this.getUid(),
|
|
|
name: fileName,
|
|
|
status: "done",
|
|
|
- url: res.url
|
|
|
+ url: fileUrl
|
|
|
};
|
|
|
- that.faceUrl = res.url;
|
|
|
+ that.faceUrl = fileUrl;
|
|
|
that.defaultImageFileList.push(upFile);
|
|
|
fileData.onSuccess();
|
|
|
});
|