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