From bbebd936b1e5d551613fb486519ff41c7c0e3e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=B8=96=E7=90=AA?= <2231925844@qq.com> Date: Mon, 20 Jan 2025 09:58:33 +0800 Subject: [PATCH] =?UTF-8?q?[UPDATE]:=E5=9F=BA=E7=A1=80=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=90=AD=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ImageUpload/index.vue | 2 +- src/views/system/system/goods/index.vue | 257 +++++++++++++++++++ src/views/system/user/profile/userAvatar.vue | 3 +- 3 files changed, 260 insertions(+), 2 deletions(-) create mode 100644 src/views/system/system/goods/index.vue diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index 55dafb8..5157f1e 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -93,7 +93,7 @@ watch(() => props.modelValue, val => { // 然后将数组转为对象数组 fileList.value = list.map(item => { if (typeof item === "string") { - if (item.indexOf(baseUrl) === -1) { + if (item.indexOf(baseUrl) === -1 && item.indexOf("http") === -1) { item = { name: baseUrl + item, url: baseUrl + item }; } else { item = { name: item, url: item }; diff --git a/src/views/system/system/goods/index.vue b/src/views/system/system/goods/index.vue new file mode 100644 index 0000000..c0242e2 --- /dev/null +++ b/src/views/system/system/goods/index.vue @@ -0,0 +1,257 @@ + + + diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue index 3b39636..dd3d473 100644 --- a/src/views/system/user/profile/userAvatar.vue +++ b/src/views/system/user/profile/userAvatar.vue @@ -126,7 +126,8 @@ function uploadImg() { formData.append("avatarfile", data, options.filename); uploadAvatar(formData).then(response => { open.value = false; - options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl; + // options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl; + options.img = response.imgUrl; userStore.avatar = options.img; proxy.$modal.msgSuccess("修改成功"); visible.value = false;