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

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,6 +1,6 @@
import { join } from 'path'
import { BrowserWindow } from 'electron'
import { debounce, encodePath, isLinux, isWin } from '@common/utils'
import { debounce, encodePath, isLinux } from '@common/utils'
import { getLyricWindowBounds } from './utils'
import { mainSend } from '@common/mainIpc'
@@ -133,7 +133,7 @@ export const createWindow = () => {
},
})
const winURL = global.isDev ? 'http://localhost:9081/lyric.html' : `file://${join(encodePath(isWin ? __dirname.replaceAll('\\', '/') : __dirname), 'lyric.html')}`
const winURL = global.isDev ? 'http://localhost:9081/lyric.html' : `file://${join(encodePath(__dirname), 'lyric.html')}`
void browserWindow.loadURL(winURL + `?dark=${shouldUseDarkColors}&theme=${encodeURIComponent(JSON.stringify(theme))}`)
winEvent()