修改阿里云上传视频文件名称,修改上传成功后的url
This commit is contained in:
parent
408f0eaa29
commit
00280e133a
|
|
@ -25,6 +25,7 @@
|
||||||
"gulp-load-plugins": "1.5.0",
|
"gulp-load-plugins": "1.5.0",
|
||||||
"gulp-replace": "0.6.1",
|
"gulp-replace": "0.6.1",
|
||||||
"hls.js": "^1.5.17",
|
"hls.js": "^1.5.17",
|
||||||
|
"js-md5": "^0.8.3",
|
||||||
"lodash": "4.17.5",
|
"lodash": "4.17.5",
|
||||||
"mockjs": "^1.1.0",
|
"mockjs": "^1.1.0",
|
||||||
"npm": "^6.9.0",
|
"npm": "^6.9.0",
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const $urlMap={
|
||||||
product:'https://video.hnsiyao.cn/sqx_fast/',
|
product:'https://video.hnsiyao.cn/sqx_fast/',
|
||||||
test:'https://video.hnsiyao.cn/sqx_fast/',
|
test:'https://video.hnsiyao.cn/sqx_fast/',
|
||||||
}
|
}
|
||||||
const $env='local'
|
const $env='product'
|
||||||
const http = axios.create({
|
const http = axios.create({
|
||||||
timeout: 1000 * 300,
|
timeout: 1000 * 300,
|
||||||
// withCredentials: true,
|
// withCredentials: true,
|
||||||
|
|
|
||||||
|
|
@ -919,9 +919,13 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
returnTypeName(){
|
returnTypeName(type){
|
||||||
const type = ['']
|
const $types = {
|
||||||
return ''
|
'1':'谢谢惠顾',
|
||||||
|
'2':'现金红包',
|
||||||
|
'3':'物品',
|
||||||
|
}
|
||||||
|
return $types[type]?$types[type]:''
|
||||||
},
|
},
|
||||||
// 转盘添加弹窗show
|
// 转盘添加弹窗show
|
||||||
refAddZhuanpanOpen(){
|
refAddZhuanpanOpen(){
|
||||||
|
|
|
||||||
|
|
@ -1726,7 +1726,9 @@
|
||||||
<script>
|
<script>
|
||||||
import OSS from "@/utils/oss-upload.js";
|
import OSS from "@/utils/oss-upload.js";
|
||||||
import { $getCredentials } from "@/api/oss.js";
|
import { $getCredentials } from "@/api/oss.js";
|
||||||
|
import md5 from "js-md5";
|
||||||
|
|
||||||
|
// 加密结果:aa888a86dca6e9d5ae216c23070e8c47
|
||||||
import { quillEditor } from "vue-quill-editor";
|
import { quillEditor } from "vue-quill-editor";
|
||||||
import "quill/dist/quill.core.css";
|
import "quill/dist/quill.core.css";
|
||||||
import "quill/dist/quill.snow.css";
|
import "quill/dist/quill.snow.css";
|
||||||
|
|
@ -1735,6 +1737,8 @@ import quillConfig from "../locality/quill-config.js";
|
||||||
// import videojs from "video.js";
|
// import videojs from "video.js";
|
||||||
// import "video.js/dist/video-js.css";
|
// import "video.js/dist/video-js.css";
|
||||||
import Hls from "hls.js";
|
import Hls from "hls.js";
|
||||||
|
import { getUUID } from "@/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
quillEditor,
|
quillEditor,
|
||||||
|
|
@ -2134,7 +2138,16 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
async onVideoFileCHange(data) {
|
async onVideoFileCHange(data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
const fileRes = await this.ossClient.partUpload(data.name, data.raw, (p) => {
|
const date = new Date();
|
||||||
|
const start =
|
||||||
|
date.getFullYear() +
|
||||||
|
"" +
|
||||||
|
(date.getMonth() * 1 + 1) +
|
||||||
|
"" +
|
||||||
|
date.getDate();
|
||||||
|
const houzhui = "." + data.name.substr(data.name.lastIndexOf(".") + 1);
|
||||||
|
const name = start + "/" + getUUID() + houzhui;
|
||||||
|
const fileRes = await this.ossClient.partUpload(name, data.raw, (p) => {
|
||||||
this.percentage = Math.floor(p * 100);
|
this.percentage = Math.floor(p * 100);
|
||||||
// 这里可以根据进度做相应的处理,例如更新UI等
|
// 这里可以根据进度做相应的处理,例如更新UI等
|
||||||
});
|
});
|
||||||
|
|
@ -2151,8 +2164,10 @@ export default {
|
||||||
if (fileRes.name == "cancel") {
|
if (fileRes.name == "cancel") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.url=fileRes
|
this.url = fileRes.replace(
|
||||||
|
"https://djvideo.oss-cn-shanghai.aliyuncs.com/",
|
||||||
|
"https://duanju.hnsiyao.cn/"
|
||||||
|
);
|
||||||
},
|
},
|
||||||
onVideoFileSubmit(data) {
|
onVideoFileSubmit(data) {
|
||||||
console.log("data");
|
console.log("data");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue