From 819a67ac9191f71cf2c32be22b5fce9a4a4a52a3 Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 5 Jul 2024 18:12:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Erar,7z=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E8=A7=A3=E5=8E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/file-type.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/file-type.js b/src/utils/file-type.js index e2fa90e..c87634d 100644 --- a/src/utils/file-type.js +++ b/src/utils/file-type.js @@ -8,7 +8,7 @@ export const suffix = { 'cmake','db','gradle','bat','conf','dart','plist' ], compressedFile: [ - 'zip','tar','jar','tar.gz','tgz','tar.bz2' + 'zip','tar','7z', 'rar', 'jar','tar.gz','tgz','tar.bz2' ], } @@ -65,6 +65,7 @@ iconClass.set('pdf','file-pdf') iconClass.set('mind','file-mind') iconClass.set('zip','zip') iconClass.set('rar','zip') +iconClass.set('7z','zip') iconClass.set('iml','file-idea') iconClass.set('key','file-key') iconClass.set('pem','file-pem') From 52b4451692c2286af88088ed76b5da0c0793eeab Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 5 Jul 2024 19:04:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E4=B8=AD=E6=9C=89'#'=E6=97=A0=E6=B3=95=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=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/ShowFile/ShowFile.vue | 22 ++++++---------------- src/utils/file-config.js | 3 ++- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index e6b01ba..a1f57d6 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -2323,7 +2323,7 @@ export default { if (searchPathIndex < 0) { keywordQuery = '' } - this.$router.push(`?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryFolder ? '&folder=' + queryFolder : ''}${queryTagId}${basePath}${keywordQuery}${searchOpenFolder}`) + this.$router.push(`?vmode=${this.vmode}&path=${encodeURI(this.path).replaceAll('#', '%23')}${queryFolder ? '&folder=' + queryFolder : ''}${queryTagId}${basePath}${keywordQuery}${searchOpenFolder}`) } if (!unRefresh) { this.pagination.pageIndex = 1 @@ -2559,13 +2559,11 @@ export default { const queryTagId = this.$route.query.tagId ? `&tagId=${this.$route.query.tagId}` : '' - const basePath = this.getBasePath() - const keyword = this.$route.query.keyword - ? `&keyword=${this.$route.query.keyword}` - : '' + const basePath = this.getBasePath().replaceAll('#', '%23') + const keyword = this.$route.query.keyword ? `&keyword=${this.$route.query.keyword}` : '' const folder = this.$route.query.folder ? `&folder=${this.$route.query.folder}` : '' const searchOpenFolder = this.$route.query.searchOpenFolder ? `&searchOpenFolder=${this.$route.query.searchOpenFolder}` : '' - this.$router.push(`?vmode=${this.vmode}&path=${this.path}${folder}${queryTagId}${basePath}${keyword}${searchOpenFolder}`) + this.$router.push(`?vmode=${this.vmode}&path=${this.path.replaceAll('#', '%23')}${folder}${queryTagId}${basePath}${keyword}${searchOpenFolder}`) // 改变拖拽目标 this.rowDrop() // 画矩形选取 @@ -2790,9 +2788,7 @@ export default { const queryTagId = this.$route.query.tagId ? `&tagId=${this.$route.query.tagId}` : '' - const path = this.$route.query.path - ? `&path=${this.$route.query.path}` - : '' + const path = this.$route.query.path ? `&path=${this.$route.query.path}`.replaceAll('#', '%23') : '' const keyword = this.$route.query.keyword ? `&keyword=${this.$route.query.keyword}` : '' @@ -4199,14 +4195,8 @@ export default { this.path = this.path.replace(/\/\//g, '/') // 去掉this.path开头的this.basePath this.path = this.path.replace(this.basePath, '/') - const path = encodeURI(this.path) + const path = encodeURI(this.path).replaceAll('#', '%23') - // if (this.path) { - // this.path += "/" + row.name; - // } else { - // this.path = this.basePath + row.name; - // } - // // 去掉this.path开头的this.basePath const item = { folder: row.name, shareBase: row.shareBase } this.pathList.push(item) this.pagination.pageIndex = 1 diff --git a/src/utils/file-config.js b/src/utils/file-config.js index 552e05e..94a8ed4 100644 --- a/src/utils/file-config.js +++ b/src/utils/file-config.js @@ -40,7 +40,8 @@ export default { } let baseUrl = serverUrl || this.baseUrl let fileUrl = `${baseUrl}/file/${owner}${encodeURI(file.path)}${encodeURI(file.name)}` - fileUrl = fileUrl.replace(/%5C/g, '/') + fileUrl = fileUrl.replaceAll('#', '%23') + fileUrl = fileUrl.replaceAll(/%5C/g, '/') if (token) { return `${fileUrl}?jmal-token=${token}&name=${username}` }