diff --git a/.env.development b/.env.development index e8d4295..4998990 100644 --- a/.env.development +++ b/.env.development @@ -11,5 +11,8 @@ ENV = 'development' VITE_ADMIN_PROXY_PATH = http://localhost:9999 #VITE_ADMIN_PROXY_PATH = http://192.168.110.156:9999 +# 图片访问基础地址 +VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api + # 代码生成服务地址 VITE_GEN_PROXY_PATH = http://192.168.110.156:5003 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/canteenDailyMenu/form.vue b/src/views/canteen/canteenDailyMenu/form.vue index 49985be..c980747 100644 --- a/src/views/canteen/canteenDailyMenu/form.vue +++ b/src/views/canteen/canteenDailyMenu/form.vue @@ -1,159 +1,161 @@ diff --git a/src/views/canteen/canteenSpu/index.vue b/src/views/canteen/canteenSpu/index.vue index 42225af..0698924 100644 --- a/src/views/canteen/canteenSpu/index.vue +++ b/src/views/canteen/canteenSpu/index.vue @@ -1,149 +1,153 @@