diff --git a/.env.production b/.env.production index 715b237..3eed313 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,4 @@ ENV = 'production' # base api -VUE_APP_BASE_API = '/' +VUE_APP_BASE_API = '/api' diff --git a/.env.staging b/.env.staging index 60627be..42f82ec 100644 --- a/.env.staging +++ b/.env.staging @@ -4,4 +4,4 @@ NODE_ENV = production ENV = 'staging' # base api -VUE_APP_BASE_API = '/' +VUE_APP_BASE_API = '/api' diff --git a/src/utils/file-config.js b/src/utils/file-config.js index 772bdf2..55cbd46 100644 --- a/src/utils/file-config.js +++ b/src/utils/file-config.js @@ -21,7 +21,7 @@ export default { window.open(url, '_self') }, publicDownload: function(shareId, file) { - let url = `${this.baseUrl}/public/s/download/${file.id}/${shareId}ff` + let url = `${this.baseUrl}/public/s/download/${file.id}/${shareId}` window.open(url, '_self') }, packageDownload: function(fileIds, token) { diff --git a/src/views/public/share/shareList.vue b/src/views/public/share/shareList.vue index 16651ae..897be37 100644 --- a/src/views/public/share/shareList.vue +++ b/src/views/public/share/shareList.vue @@ -919,7 +919,7 @@ return } // 打开文件 - fileConfig.preview(this.$store.state.user.token, row) + fileConfig.publicPreview(row.id) } } } diff --git a/src/views/public/share/shareList_m.vue b/src/views/public/share/shareList_m.vue index 4744dad..2bbe247 100644 --- a/src/views/public/share/shareList_m.vue +++ b/src/views/public/share/shareList_m.vue @@ -870,7 +870,7 @@ return } // 打开文件 - fileConfig.preview(this.$store.state.user.token, row) + fileConfig.publicPreview(row.id) } } } diff --git a/src/websocket/websocket_config.js b/src/websocket/websocket_config.js index 8c1a623..e1f4d5e 100644 --- a/src/websocket/websocket_config.js +++ b/src/websocket/websocket_config.js @@ -1,9 +1,12 @@ let host = window.location.host; +let url = `${document.location.protocol}//${host}`; +if(process.env.NODE_ENV === 'development'){ if (window.location.port.length > 0) { host = window.location.host.substring(0, window.location.host.length - window.location.port.length - 1) } -const url = `${document.location.protocol}//${host}:8088`; + url = `${document.location.protocol}//${host}:8088`; +} let stompClient = ''; let isConnected = false; let timer = '';