From 7562135ee0944173962838f396fe408f7fd86308 Mon Sep 17 00:00:00 2001 From: ctw <> Date: Wed, 25 Dec 2024 14:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E8=B0=B1=E4=B8=8B=E7=9A=84=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=EF=BC=8C=E5=B0=81=E9=9D=A2=E5=9B=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=BA=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 + src/components/Upload/Images.vue | 3 +- src/views/canteen/canteenSpu/index.vue | 233 +++++++++++++------------ 3 files changed, 124 insertions(+), 115 deletions(-) diff --git a/.env.development b/.env.development index 3466e92..55ede7e 100644 --- a/.env.development +++ b/.env.development @@ -10,5 +10,8 @@ ENV = 'development' # ADMIN 服务地址 VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ +# 图片访问基础地址 +VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api + # 代码生成服务地址 VITE_GEN_PROXY_PATH = http://localhost:5003 \ No newline at end of file diff --git a/src/components/Upload/Images.vue b/src/components/Upload/Images.vue index 53d90ea..1aae577 100644 --- a/src/components/Upload/Images.vue +++ b/src/components/Upload/Images.vue @@ -69,6 +69,7 @@ const dialogVisible = ref(false); const elUploadRef = ref(); // 获取 el-form 组件上下文 const formContext = inject(formContextKey, void 0); +const imageBaseUrl = import.meta.env.VITE_IMAGE_BASE_PATH; // 上传 const handleHttpUpload = async (options: UploadRequestOptions) => { @@ -99,7 +100,7 @@ const handleRemove = (uploadFile: any, uploadFiles: any[]) => { // 预览 const handlePictureCardPreview = (uploadFile: any) => { - dialogImageUrl.value = 'http://123.156.230.15:8089/api' + uploadFile.response.data.url; + dialogImageUrl.value = imageBaseUrl + uploadFile.response.data.url; dialogVisible.value = true; }; diff --git a/src/views/canteen/canteenSpu/index.vue b/src/views/canteen/canteenSpu/index.vue index 42225af..834ab56 100644 --- a/src/views/canteen/canteenSpu/index.vue +++ b/src/views/canteen/canteenSpu/index.vue @@ -1,149 +1,154 @@