perf: The use of .replaceAll('#', '%23') is now redundant. encodeURIComponent used on the previous line already handles encoding the # character. This line can be removed.
This commit is contained in:
parent
00c0d99225
commit
f73b7defb0
@ -2431,7 +2431,7 @@ export default {
|
|||||||
keywordQuery = ''
|
keywordQuery = ''
|
||||||
searchOpenFolder = ''
|
searchOpenFolder = ''
|
||||||
}
|
}
|
||||||
this.$router.push(`?vmode=${this.vmode}&path=${encodeURIComponent(this.path).replaceAll('#', '%23')}${queryFolder ? '&folder=' + queryFolder : ''}${queryTagId}${basePath}${keywordQuery}${searchOpenFolder}`)
|
this.$router.push(`?vmode=${this.vmode}&path=${encodeURIComponent(this.path)}${queryFolder ? '&folder=' + queryFolder : ''}${queryTagId}${basePath}${keywordQuery}${searchOpenFolder}`)
|
||||||
}
|
}
|
||||||
if (!unRefresh) {
|
if (!unRefresh) {
|
||||||
this.pagination.pageIndex = 1
|
this.pagination.pageIndex = 1
|
||||||
@ -4423,7 +4423,7 @@ export default {
|
|||||||
this.path = this.path.replace(/\/\//g, '/')
|
this.path = this.path.replace(/\/\//g, '/')
|
||||||
// 去掉this.path开头的this.basePath
|
// 去掉this.path开头的this.basePath
|
||||||
this.path = this.path.replace(this.basePath, '/')
|
this.path = this.path.replace(this.basePath, '/')
|
||||||
const path = encodeURIComponent(this.path).replaceAll('#', '%23')
|
const path = encodeURIComponent(this.path)
|
||||||
const item = { folder: row.name, shareBase: row.shareBase }
|
const item = { folder: row.name, shareBase: row.shareBase }
|
||||||
this.pathList.push(item)
|
this.pathList.push(item)
|
||||||
this.pagination.pageIndex = 1
|
this.pagination.pageIndex = 1
|
||||||
|
|||||||
@ -37,7 +37,6 @@ export default {
|
|||||||
previewUrl: function(username, file, token, shareToken, serverUrl) {
|
previewUrl: function(username, file, token, shareToken, serverUrl) {
|
||||||
let baseUrl = serverUrl || this.baseUrl
|
let baseUrl = serverUrl || this.baseUrl
|
||||||
let fileUrl = `${baseUrl}/file/${store.getters.name}${encodeURIComponent(file.path)}${encodeURIComponent(file.name)}`
|
let fileUrl = `${baseUrl}/file/${store.getters.name}${encodeURIComponent(file.path)}${encodeURIComponent(file.name)}`
|
||||||
fileUrl = fileUrl.replaceAll('#', '%23')
|
|
||||||
fileUrl = fileUrl.replaceAll(/%5C/g, '/')
|
fileUrl = fileUrl.replaceAll(/%5C/g, '/')
|
||||||
|
|
||||||
if (file.userId !== store.getters.userId && token && !shareToken) {
|
if (file.userId !== store.getters.userId && token && !shareToken) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user