diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 13b3d42..e8606a0 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -702,5 +702,8 @@ export function uploadPicApi(data) { url: "/api/upload", method: "post", data, + headers: { + "Content-Type": "multipart/form-data", // set the content type to multipart/form-data + }, }); } diff --git a/src/views/realTimeMonitor/components/uploadpic.vue b/src/views/realTimeMonitor/components/uploadpic.vue index 45d0d15..7395641 100644 --- a/src/views/realTimeMonitor/components/uploadpic.vue +++ b/src/views/realTimeMonitor/components/uploadpic.vue @@ -13,7 +13,7 @@ - + @@ -70,11 +70,12 @@ export default { display(data) { console.log(data); this.$set(this.form, "cmdid", data.cmdid); - this.$set(this.form, "id", data.id); + this.$set(this.form, "termid", data.id); this.isShow = true; }, handleclose() { this.isShow = false; + this.fileList = []; }, handlesure() { this.isShow = false; @@ -84,6 +85,13 @@ export default { uploadPicApi(this.form) .then((res) => { console.log(res); + this.$message({ + duration: 1500, + showClose: true, + message: "上传成功", + type: "success", + }); + this.fileList = []; }) .catch((err) => {}); },