From a35bcbf900e302da1f0becf6b9711807fd319de9 Mon Sep 17 00:00:00 2001 From: miaojiale <1123971748@qq.com> Date: Fri, 12 May 2023 17:11:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 1 + .env.production | 1 + src/components/Upload/index.vue | 9 ++++++--- src/components/UploadForOperation/index.vue | 11 +++++------ src/views/Home/HealthPopularization/index.vue | 5 +++-- src/views/Home/ScientificResearch/index.vue | 3 ++- src/views/Home/index.vue | 4 +++- 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.env.development b/.env.development index b80dbef..60ce4cc 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,6 @@ NODE_ENV = 'development' VUE_APP_BASE_API = 'mockServer' VUE_APP_BASE_API = 'http://192.168.31.140:11999/' +VUE_APP_UPLOAD_API = 'https://ds.cixincloud.com/geca-api/disease-data/file/info/' VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production index 90e9d29..d8bdcd4 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,4 @@ NODE_ENV = 'production' VUE_APP_BASE_API = '/geca-api/' +VUE_APP_UPLOAD_API = '/geca-api/disease-data/file/info/' diff --git a/src/components/Upload/index.vue b/src/components/Upload/index.vue index 987f9d9..4dbe29e 100644 --- a/src/components/Upload/index.vue +++ b/src/components/Upload/index.vue @@ -99,6 +99,7 @@ export default { ? "/api" : process.env.VUE_APP_BASE_API, fileList: [], + uploadPrefix: process.env.VUE_APP_UPLOAD_API, } }, computed: { @@ -119,7 +120,7 @@ export default { return this.value.map((_) => { return ( _.url || - `/geca-api/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}` + this.uploadPrefix + `${_.bucket_name}/${_.prefix}-${_.uuid_name}` ) }) }, @@ -132,7 +133,8 @@ export default { this.fileList = newValue.map((_) => { return { name: _.file_name, - url: `/geca-api/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`, + url: + this.uploadPrefix + `${_.bucket_name}/${_.prefix}-${_.uuid_name}`, } }) }, @@ -204,7 +206,8 @@ export default { let responseUrl if (file.response) { const _ = file.response.data - responseUrl = `/geca-api/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}` + responseUrl = + this.uploadPrefix + `${_.bucket_name}/${_.prefix}-${_.uuid_name}` } try { if (name.match(/\.(png|jpg|jpeg)/)) { diff --git a/src/components/UploadForOperation/index.vue b/src/components/UploadForOperation/index.vue index 24d2d99..56a2f6d 100644 --- a/src/components/UploadForOperation/index.vue +++ b/src/components/UploadForOperation/index.vue @@ -124,6 +124,7 @@ export default { type: String, default: "primary", }, + value: { type: Array, default: () => [], @@ -133,6 +134,7 @@ export default { return { imgUrl: "", title: "", + uploadPrefix: process.env.VUE_APP_UPLOAD_API, httpPrefix: process.env.NODE_ENV === "development" ? "/api" @@ -154,10 +156,7 @@ export default { console.log(this.value) if (!this.value.length || this.accept != "image/*") return [] return this.value.map((_) => { - return ( - _.url || - `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}` - ) + return _.url || this.uploadPrefix + `${_.bucketName}/${_.uuidName}` }) }, }, @@ -168,7 +167,7 @@ export default { this.fileList = newValue.map((_) => { return { name: _.fileName, - url: `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}`, + url: this.uploadPrefix + `${_.bucketName}/${_.uuidName}`, } }) }, @@ -235,7 +234,7 @@ export default { let responseUrl if (file.response) { const _ = file.response.data - responseUrl = `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}` + responseUrl = this.uploadPrefix + `${_.bucketName}/${_.uuidName}` } try { if (name.match(/\.(png|jpg|jpeg)/)) { diff --git a/src/views/Home/HealthPopularization/index.vue b/src/views/Home/HealthPopularization/index.vue index 427f01e..2f3b126 100644 --- a/src/views/Home/HealthPopularization/index.vue +++ b/src/views/Home/HealthPopularization/index.vue @@ -19,7 +19,7 @@