处理路径中存在百分号导致的问题

This commit is contained in:
lyswhut
2022-11-04 20:27:51 +08:00
parent 209bf9e0aa
commit 11d3754c08
12 changed files with 35 additions and 29 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
// return listId == 'download' ? downloadList : getListFromState(listId)
// }
import { commonColorNames, commonDarkColorValues, commonLightColorValues } from '@common/config'
import { isUrl } from '@common/utils/common'
import { encodePath, isUrl } from '@common/utils/common'
import { joinPath } from '@common/utils/nodejs'
import { markRaw, shallowReactive } from '@common/utils/vueTools'
import { getThemes as getTheme } from '@renderer/utils/ipc'
@@ -19,7 +19,7 @@ export const assertApiSupport = (source: LX.Source): boolean => {
export const buildBgUrl = (originUrl: string, dataPath: string): string => {
return isUrl(originUrl)
? `url(${originUrl})`
: `url(file:///${joinPath(dataPath, originUrl).replaceAll('\\', '/')})`
: `url(file:///${encodePath(joinPath(dataPath, originUrl).replaceAll('\\', '/'))})`
}
export const getThemes = (callback: (themeInfo: LX.ThemeInfo) => void) => {