mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-04 19:08:14 +00:00
fix: 修复部分页面出现空白的情况
This commit is contained in:
parent
d1702bd62c
commit
83d3b3ffbf
2
electron/electron.js
vendored
2
electron/electron.js
vendored
@ -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) {
|
||||
|
||||
5
resources/assets/js/app.js
vendored
5
resources/assets/js/app.js
vendored
@ -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()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user