From 843f08984b8174cbd00d989280c8f7ab3ca495b4 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 5 Jan 2021 21:08:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=BB=84=E4=BB=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=84=E8=A7=88&=E7=A7=BB=E9=99=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/UploadImage/index.vue | 48 +++++++++++++++---- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/ruoyi-ui/src/components/UploadImage/index.vue b/ruoyi-ui/src/components/UploadImage/index.vue index bc76d96..ce540eb 100644 --- a/ruoyi-ui/src/components/UploadImage/index.vue +++ b/ruoyi-ui/src/components/UploadImage/index.vue @@ -11,9 +11,28 @@ :headers="headers" style="display: inline-block; vertical-align: top" > - - + +
+ +
+
+
+ +
+
+ + + + + + +
+
+
+ + + @@ -21,10 +40,10 @@ import { getToken } from "@/utils/auth"; export default { - components: {}, data() { return { - uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址 + dialogVisible: false, + uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 headers: { Authorization: "Bearer " + getToken(), }, @@ -37,8 +56,11 @@ export default { }, }, methods: { + removeImage() { + this.$emit("input", ""); + }, handleUploadSuccess(res) { - this.$emit("input", res.data.url); + this.$emit("input", res.url); this.loading.close(); }, handleBeforeUpload() { @@ -61,8 +83,18 @@ export default { \ No newline at end of file