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(), },