From 20f3694dc6f6954790b243b71c88202a4470fe72 Mon Sep 17 00:00:00 2001 From: Jane <272005125@qq.com> Date: Tue, 16 Jul 2024 17:45:54 +0800 Subject: [PATCH] update --- .env.development | 1 + .env.production | 1 + .env.staging | 3 ++- src/views/document/index.vue | 4 ++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index 51464fc..399b5fd 100644 --- a/.env.development +++ b/.env.development @@ -8,6 +8,7 @@ VUE_APP_CONTEXT_PATH = '/tool-tech' # 工具与技术交流管理系统/开发环境 VUE_APP_BASE_API = 'http://localhost:8080/tool-tech-admin' +VUE_APP_WS_URL = 'ws://localhost:8080/tool-tech-admin/websocket' # 文档在线预览服务 VUE_APP_TOOL_TECH_FILE_VIEW_API = 'http://localhost:8012/tool-tech-file-view' diff --git a/.env.production b/.env.production index 4c4823e..7d908c3 100644 --- a/.env.production +++ b/.env.production @@ -8,6 +8,7 @@ VUE_APP_CONTEXT_PATH = '/tool-tech' # 工具与技术交流管理系统/生产环境 VUE_APP_BASE_API = '/prod-api' +VUE_APP_WS_URL = 'wss://www.rzdata.net/tool-tech-admin/websocket' # 文档在线预览服务 VUE_APP_TOOL_TECH_FILE_VIEW_API = 'http://localhost:8012/tool-tech-file-view' diff --git a/.env.staging b/.env.staging index de8b743..bf18a84 100644 --- a/.env.staging +++ b/.env.staging @@ -10,9 +10,10 @@ VUE_APP_CONTEXT_PATH = '/tool-tech' # 工具与技术交流管理系统/测试环境 VUE_APP_BASE_API = 'https://www.rzdata.net/tool-tech-admin' +VUE_APP_WS_URL = 'wss://www.rzdata.net/tool-tech-admin/websocket' # 文档在线预览服务 -VUE_APP_TOOL_TECH_FILE_VIEW_API = 'http://localhost:8012/tool-tech-file-view' +VUE_APP_TOOL_TECH_FILE_VIEW_API = 'https://www.rzdata.net/tool-tech-file-view' # 流程管理服务地址 VUE_APP_WORKFLOW_MANAGE_URL = 'http://localhost:8085/ebpm-process-manage' diff --git a/src/views/document/index.vue b/src/views/document/index.vue index f486057..9b25d53 100644 --- a/src/views/document/index.vue +++ b/src/views/document/index.vue @@ -198,7 +198,7 @@ export default { return uniqueID; }, initWebSocket() { - this.websocket = new WebSocket('ws://localhost:8080/tool-tech-admin/websocket'); + this.websocket = new WebSocket(process.env.VUE_APP_WS_URL); this.websocket.onmessage = (event) => { const msgStr = event.data; console.log('上传进度=' + msgStr); @@ -238,7 +238,7 @@ export default { formData.append('docId', docId) formData.append('requestId', this.generateUniqueID()) //自定义的接口也可以用ajax或者自己封装的接口 - axios.post('http://localhost:8080/tool-tech-admin/document/upload', formData, { + axios.post(process.env.VUE_APP_BASE_API + '/document/upload', formData, { headers: { 'Content-Type': 'multipart/form-data', 'Authorization': 'Bearer ' + getToken(),