From f50ec101a0dd2d061f5187e1539d40243870150f Mon Sep 17 00:00:00 2001 From: TiaStars Date: Thu, 2 Jan 2025 15:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 4 ++-- src/utils/request.js | 4 ++-- src/views/auditPages/assetsManagement/email.vue | 4 ++-- src/views/auditPages/assetsManagement/index.vue | 4 ++-- .../auditPages/assetsManagement/mobileApplication.vue | 4 ++-- src/views/auditPages/assetsManagement/officialAccount.vue | 4 ++-- src/views/auditPages/assetsManagement/program.vue | 4 ++-- src/views/components/myUpload/index.vue | 8 ++++---- vue.config.js | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.env.production b/.env.production index f542820..ffd1313 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,5 @@ VUE_APP_TITLE = 太仓市网络和数据资产采集管理系统 ENV = 'production' # 若依管理系统/生产环境 -# VUE_APP_BASE_API = 'http://39.101.188.84:9115' -VUE_APP_BASE_API = 'http://20.1.0.164/api' +VUE_APP_BASE_API = 'http://39.101.188.84:9115' +# VUE_APP_BASE_API = 'http://20.1.0.164/api' diff --git a/src/utils/request.js b/src/utils/request.js index b286e75..827b69c 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -15,8 +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.NODE_ENV === "production" ? location.origin + '/api' : 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 5eaa5d2..b6be177 100644 --- a/src/views/auditPages/assetsManagement/email.vue +++ b/src/views/auditPages/assetsManagement/email.vue @@ -239,8 +239,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - // url: process.env.VUE_APP_BASE_API + "/tc/assetEmail/importData" - url: location.origin + "/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 54b3962..69fce46 100644 --- a/src/views/auditPages/assetsManagement/index.vue +++ b/src/views/auditPages/assetsManagement/index.vue @@ -258,8 +258,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - // url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import" - url: location.origin + "/api/tc/assetCurrent/importData" + 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 be5ce90..1cd4715 100644 --- a/src/views/auditPages/assetsManagement/mobileApplication.vue +++ b/src/views/auditPages/assetsManagement/mobileApplication.vue @@ -265,8 +265,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - // url: process.env.VUE_APP_BASE_API + "/tc/assetApp/importData" - url: location.origin + "/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 35ee3c9..9afc76e 100644 --- a/src/views/auditPages/assetsManagement/officialAccount.vue +++ b/src/views/auditPages/assetsManagement/officialAccount.vue @@ -251,8 +251,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - // url: process.env.VUE_APP_BASE_API + "/tc/assetOfficialAccount/importData" - url: location.origin + "/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 df2075b..1d0630f 100644 --- a/src/views/auditPages/assetsManagement/program.vue +++ b/src/views/auditPages/assetsManagement/program.vue @@ -250,8 +250,8 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - // url: process.env.VUE_APP_BASE_API + "/tc/miniPrograms/importData" - url: location.origin + "/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 173826c..b92e585 100644 --- a/src/views/components/myUpload/index.vue +++ b/src/views/components/myUpload/index.vue @@ -67,10 +67,10 @@ export default { return { number: 0, uploadList: [], - // baseUrl: process.env.VUE_APP_BASE_API, - baseUrl: location.origin + '/api', - // uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址 - uploadFileUrl: location.origin + '/api/common/upload', + baseUrl: process.env.VUE_APP_BASE_API, + // baseUrl: location.origin + '/api', + uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址 + // uploadFileUrl: location.origin + '/api/common/upload', headers: { Authorization: "Bearer " + getToken(), }, diff --git a/vue.config.js b/vue.config.js index 6a0ac7f..3776cf0 100644 --- a/vue.config.js +++ b/vue.config.js @@ -18,8 +18,8 @@ module.exports = { // 部署生产环境和开发环境下的URL。 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 - // publicPath: process.env.NODE_ENV === "production" ? "/demo/TcAssetVerificationPc" : "/", - publicPath: process.env.NODE_ENV === "production" ? "./" : "/", + publicPath: process.env.NODE_ENV === "production" ? "/demo/TcAssetVerificationPc" : "/", + // publicPath: process.env.NODE_ENV === "production" ? "./" : "/", // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) outputDir: 'dist', // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)