From 9c2eacaca0e0691734c783f2db9d415740169d38 Mon Sep 17 00:00:00 2001 From: TiaStars Date: Mon, 30 Dec 2024 15:50:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=8E=AF=E5=A2=83=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=9C=B0=E5=9D=80=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 3 ++- src/views/auditPages/assetsManagement/email.vue | 3 ++- src/views/auditPages/assetsManagement/index.vue | 3 ++- src/views/auditPages/assetsManagement/mobileApplication.vue | 3 ++- src/views/auditPages/assetsManagement/officialAccount.vue | 3 ++- src/views/auditPages/assetsManagement/program.vue | 3 ++- src/views/components/myUpload/index.vue | 6 ++++-- 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index c9f3c6b..b286e75 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -15,7 +15,8 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' // 创建axios实例 const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 - baseURL: process.env.VUE_APP_BASE_API, + // baseURL: process.env.VUE_APP_BASE_API, + baseURL: process.env.NODE_ENV === "production" ? location.origin + '/api' : process.env.VUE_APP_BASE_API, // 超时 timeout: 50000 }) diff --git a/src/views/auditPages/assetsManagement/email.vue b/src/views/auditPages/assetsManagement/email.vue index 1d7765d..11e280e 100644 --- a/src/views/auditPages/assetsManagement/email.vue +++ b/src/views/auditPages/assetsManagement/email.vue @@ -239,7 +239,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/tc/assetEmail/importData" + // url: process.env.VUE_APP_BASE_API + "/tc/assetEmail/importData" + url: location.origin + "/api/tc/assetEmail/importData" }, } }, diff --git a/src/views/auditPages/assetsManagement/index.vue b/src/views/auditPages/assetsManagement/index.vue index 8db5d3d..03f6401 100644 --- a/src/views/auditPages/assetsManagement/index.vue +++ b/src/views/auditPages/assetsManagement/index.vue @@ -258,7 +258,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import" + // url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import" + url: location.origin + "/api/tc/assetCurrent/importData" }, } }, diff --git a/src/views/auditPages/assetsManagement/mobileApplication.vue b/src/views/auditPages/assetsManagement/mobileApplication.vue index 4600aa7..87d1c80 100644 --- a/src/views/auditPages/assetsManagement/mobileApplication.vue +++ b/src/views/auditPages/assetsManagement/mobileApplication.vue @@ -265,7 +265,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/tc/assetApp/importData" + // url: process.env.VUE_APP_BASE_API + "/tc/assetApp/importData" + url: location.origin + "/api/tc/assetApp/importData" }, } }, diff --git a/src/views/auditPages/assetsManagement/officialAccount.vue b/src/views/auditPages/assetsManagement/officialAccount.vue index 84d934e..958d24d 100644 --- a/src/views/auditPages/assetsManagement/officialAccount.vue +++ b/src/views/auditPages/assetsManagement/officialAccount.vue @@ -251,7 +251,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/tc/assetOfficialAccount/importData" + // url: process.env.VUE_APP_BASE_API + "/tc/assetOfficialAccount/importData" + url: location.origin + "/api/tc/assetOfficialAccount/importData" }, } }, diff --git a/src/views/auditPages/assetsManagement/program.vue b/src/views/auditPages/assetsManagement/program.vue index 3a2b61e..280743c 100644 --- a/src/views/auditPages/assetsManagement/program.vue +++ b/src/views/auditPages/assetsManagement/program.vue @@ -250,7 +250,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/tc/miniPrograms/importData" + // url: process.env.VUE_APP_BASE_API + "/tc/miniPrograms/importData" + url: location.origin + "/api/tc/miniPrograms/importData" }, } }, diff --git a/src/views/components/myUpload/index.vue b/src/views/components/myUpload/index.vue index 4a2c055..0025ea5 100644 --- a/src/views/components/myUpload/index.vue +++ b/src/views/components/myUpload/index.vue @@ -67,8 +67,10 @@ export default { return { number: 0, uploadList: [], - baseUrl: process.env.VUE_APP_BASE_API, - uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址 + // baseUrl: process.env.VUE_APP_BASE_API, + baseUrl: location.origin, + // uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址 + uploadFileUrl: location.origin + '/api/common/upload', headers: { Authorization: "Bearer " + getToken(), },