fix: 修复部分页面出现空白的情况
This commit is contained in:
Vendored
+1
-1
@@ -439,7 +439,7 @@ function createChildWindow(args) {
|
||||
electronMenu.webContentsMenu(browser.webContents)
|
||||
|
||||
// 加载地址
|
||||
const hash = args.hash || args.path;
|
||||
const hash = `${args.hash || args.path}`;
|
||||
if (/^https?:/i.test(hash)) {
|
||||
browser.loadURL(hash).then(_ => { }).catch(_ => { })
|
||||
} else if (isPreload) {
|
||||
|
||||
Vendored
+4
-1
@@ -341,7 +341,7 @@ const $preload = async () => {
|
||||
}
|
||||
|
||||
await store.dispatch("preload");
|
||||
const hash = (window.location[routeMode === 'history' ? 'pathname' : 'hash']).replace(/^[#\/\s]/, '');
|
||||
const hash = (window.location[routeMode === 'history' ? 'pathname' : 'hash']).replace(/^[#\/\s]+/, '');
|
||||
if (hash !== 'preload') {
|
||||
await $init()
|
||||
return
|
||||
@@ -355,6 +355,9 @@ const $preload = async () => {
|
||||
}
|
||||
route = route.replace(/^https?:\/\/[^\/]+/, '');
|
||||
}
|
||||
if (routeMode === 'hash') {
|
||||
route = `#/${route.replace(/^[#\/\s]+/, '')}`;
|
||||
}
|
||||
window.history.replaceState(null, '', route)
|
||||
await $init()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user