From e24350cb85054fe9f2862633c68bd830b31b2c4c Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 14 May 2020 17:10:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E4=BD=BF=E7=94=A8ng?= =?UTF-8?q?inx=E4=BB=A3=E7=90=86=E8=AE=BF=E9=97=AE=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=A4=9A=E4=B8=AA=E6=96=87=E4=BB=B6=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 2 +- src/components/ShowFile/ShowFile.vue | 15 ++++++++++++++- src/router/index.js | 24 ++++++++++++------------ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/public/index.html b/public/index.html index f5aac48..28d9c8a 100644 --- a/public/index.html +++ b/public/index.html @@ -8,7 +8,7 @@ - + <%= webpackConfig.name %> diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 0219fab..2a67abb 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -2243,7 +2243,20 @@ }else{ fileIds.push(this.rowContextData.id) } - window.open(process.env.VUE_APP_BASE_FILE_API + 'download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self') + let host = window.location.host + if(window.location.port.length > 0){ + host = window.location.host.substring(0,window.location.host.length - window.location.port.length - 1) + } + console.log(host) + if(process.env.NODE_ENV !== 'development'){ + let host = window.location.host + if(window.location.port.length > 0){ + host = window.location.host.substring(0,window.location.host.length - window.location.port.length - 1) + } + window.open(`http://${host}:8088/download?jmal-token=${this.$store.state.user.token}&fileIds=${fileIds}`,'_self') + }else{ + window.open(process.env.VUE_APP_BASE_FILE_API + '/download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self') + } } else { this.$message({ message: '所选文件为空', diff --git a/src/router/index.js b/src/router/index.js index a071ee4..0221d89 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -164,18 +164,18 @@ export const constantRoutes = [ ] }, - { - path: '/demo', - component: Layout, - children: [ - { - path: 'index', - name: 'demo', - component: () => import('@/views/demo/index'), - meta: { title: 'demo', icon: 'example' } - } - ] - }, + // { + // path: '/demo', + // component: Layout, + // children: [ + // { + // path: 'index', + // name: 'demo', + // component: () => import('@/views/demo/index'), + // meta: { title: 'demo', icon: 'example' } + // } + // ] + // }, { path: '/markdown',