mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-22 01:28:12 +00:00
fix(electron): 修复客户端 loadHash 域名判断逻辑
修复当 mainDomain 为 "public" 时无法正确判断域名的问题, 改为从缓存的 cacheServerUrl 获取实际域名进行比较。 同时修正跳转时错误使用 url 变量的问题,改为正确的 loadHash。
This commit is contained in:
parent
f4f9ee1d3d
commit
9cb8c92492
8
resources/assets/js/app.js
vendored
8
resources/assets/js/app.js
vendored
@ -357,8 +357,12 @@ const $preload = async () => {
|
|||||||
document.querySelector(".app-view-loading")?.setAttribute("data-visible", "false")
|
document.querySelector(".app-view-loading")?.setAttribute("data-visible", "false")
|
||||||
window.__initializeApp = async (loadHash) => {
|
window.__initializeApp = async (loadHash) => {
|
||||||
if (/^https?:\/\//.test(loadHash)) {
|
if (/^https?:\/\//.test(loadHash)) {
|
||||||
if ($A.getDomain(loadHash) !== $A.mainDomain()) {
|
let mainDomain = $A.mainDomain()
|
||||||
window.location.href = url;
|
if (mainDomain === "public") {
|
||||||
|
mainDomain = $A.getDomain(await $A.IDBString("cacheServerUrl"))
|
||||||
|
}
|
||||||
|
if ($A.getDomain(loadHash) !== mainDomain) {
|
||||||
|
window.location.href = loadHash;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loadHash = loadHash.replace(/^https?:\/\/[^\/]+/, '');
|
loadHash = loadHash.replace(/^https?:\/\/[^\/]+/, '');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user