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

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
@@ -1,4 +1,4 @@
import { isUrl, throttle } from '@common/utils'
import { encodePath, isUrl, throttle } from '@common/utils'
import migrateSetting from '@common/utils/migrateSetting'
import getStore from '@main/utils/store'
import { STORE_NAMES, URL_SCHEME_RXP } from '@common/constants'
@@ -250,7 +250,7 @@ export const getTheme = () => {
theme.config.extInfo['--background-image'] =
isUrl(theme.config.extInfo['--background-image'])
? `url(${theme.config.extInfo['--background-image']})`
: `url(file:///${joinPath(global.lxDataPath, 'theme_images', theme.config.extInfo['--background-image']).replaceAll('\\', '/')})`
: `url(file:///${encodePath(joinPath(global.lxDataPath, 'theme_images', theme.config.extInfo['--background-image']).replaceAll('\\', '/'))})`
}
} else {
themeId = global.lx.appSetting['theme.id'] == 'auto' && shouldUseDarkColors ? 'black' : 'green'