Commit 9cf21866 by hanjixin

修改了视频上传之后的存储

parent e9489f9a
......@@ -148,6 +148,9 @@ export function getUserInfo() {
// 获取用户信息
return get(`/user/get/info`)
}
export function checkVideoCompress(videoSrc = []) {
return get(`/user/get/info`, videoSrc)
}
export function upload(file) {
// 上传文件
let formData = new FormData()
......
......@@ -6,7 +6,8 @@ const app = {
withoutAnimation: false
},
device: 'desktop',
errorData: {}
errorData: {},
videoSrc: []
},
mutations: {
TOGGLE_SIDEBAR: state => {
......@@ -28,6 +29,12 @@ const app = {
},
SET_ERROR_DATA: (state, errorData) => {
state.errorData = errorData
},
SET_VIDEO_SRC : (state, videoSrc) => {
state.videoSrc = state.videoSrc.push(videoSrc)
},
CLEAR_VIDEO_SRC : (state) => {
state.videoSrc = []
}
},
actions: {
......
......@@ -356,7 +356,7 @@ export default {
}, 300);
}
},
uploadFile(data) {
uploadFile(data, isVideo) {
this.$toast.loading({
mask: true,
duration: 0,
......@@ -364,6 +364,9 @@ export default {
});
upload(data)
.then(res => {
if(isVideo) {
this.$store.commit('SET_VIDEO_SRC', res.data.data)
}
// this.schemaData[this.dataKey].value = res.data.data;
if (this.itemKey) {
this.setSchemaListData(res.data.data);
......@@ -506,7 +509,7 @@ export default {
document.querySelector(".edit-container").style.height = "100vh";
this.VueCropperOption.img = file.content;
} else {
this.uploadFile(file.file);
this.uploadFile(file.file), String(file.file.type).indexOf("image") === -1;
}
},
checkboxChange(value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment