mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-23 09:20:44 +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)
|
electronMenu.webContentsMenu(browser.webContents)
|
||||||
|
|
||||||
// 加载地址
|
// 加载地址
|
||||||
const hash = args.hash || args.path;
|
const hash = `${args.hash || args.path}`;
|
||||||
if (/^https?:/i.test(hash)) {
|
if (/^https?:/i.test(hash)) {
|
||||||
browser.loadURL(hash).then(_ => { }).catch(_ => { })
|
browser.loadURL(hash).then(_ => { }).catch(_ => { })
|
||||||
} else if (isPreload) {
|
} 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");
|
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') {
|
if (hash !== 'preload') {
|
||||||
await $init()
|
await $init()
|
||||||
return
|
return
|
||||||
@ -355,6 +355,9 @@ const $preload = async () => {
|
|||||||
}
|
}
|
||||||
route = route.replace(/^https?:\/\/[^\/]+/, '');
|
route = route.replace(/^https?:\/\/[^\/]+/, '');
|
||||||
}
|
}
|
||||||
|
if (routeMode === 'hash') {
|
||||||
|
route = `#/${route.replace(/^[#\/\s]+/, '')}`;
|
||||||
|
}
|
||||||
window.history.replaceState(null, '', route)
|
window.history.replaceState(null, '', route)
|
||||||
await $init()
|
await $init()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user