From bbed91b05e9e32c7fce3c100fdb77ad0a7dd1718 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Tue, 9 Jan 2024 21:38:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api/index.js | 3 +++ src/views/realTimeMonitor/components/uploadpic.vue | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) 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) => {}); },