From 4a08337bbc4d628e6e320a4deba3093334cc4e77 Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 6 Mar 2020 14:26:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8A=E4=BC=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E6=8A=9B=E5=87=BA=E5=88=9B=E5=BB=BA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E5=A4=B1=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 --- src/components/Icon/IconFile.vue | 2 +- src/utils/request.js | 2 +- src/views/home/index.vue | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Icon/IconFile.vue b/src/components/Icon/IconFile.vue index a1368fd..a706b95 100644 --- a/src/components/Icon/IconFile.vue +++ b/src/components/Icon/IconFile.vue @@ -6,7 +6,7 @@ - + diff --git a/src/utils/request.js b/src/utils/request.js index 6f64010..8bdecc6 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -55,7 +55,7 @@ service.interceptors.response.use( }) }else{ Message({ - message: '服务器开小差了...', + message: res.message || '服务器开小差了...', type: 'error', duration: 3 * 1000 }) diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 7d54128..467859c 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -621,7 +621,7 @@ export default { if (!this.$route.query.path){ this.$router.push(`/_m`) } else { - this.$router.push(`?path=${this.path}`) + this.$router.push(`?path=${encodeURIComponent(this.path)}`) } } setPath(this.path, this.pathList) @@ -1393,18 +1393,20 @@ export default { this.pathList.push(item2) setPath(this.path, this.pathList) this.pagination.pageIndex = 1 - console.log(this.path) - this.$router.push(`?path=${this.path}`) + const path = encodeURIComponent(this.path); + this.$router.push(`?path=${path}`) this.getFileList() } } else { if(row.contentType.includes('text')){ + // let routeData = this.$router.resolve({path: '/public/p',query: {mark: row.id}}) + // window.open(routeData.href, '_blank'); this.$router.push(`/public/p?mark=${row.id}`) }else{ // 打开文件 const fileIds = [row.id] const url = process.env.VUE_APP_BASE_FILE_API + 'preview/' + row.name + '?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds - window.open(url, '_blank') + window.open(url, '_self') } } }