perf: 优化访问链接

This commit is contained in:
kuaifan 2025-04-14 11:55:29 +08:00
parent 6e6a50b46e
commit d4697cb203
11 changed files with 29 additions and 21 deletions

View File

@ -606,11 +606,7 @@ export default {
pageType: 'app',
pageTitle: ' ',
url: 'web.js',
params: {
url,
browser: true,
showProgress: true,
},
params: {url},
})
}
//

View File

@ -713,9 +713,7 @@ export default {
pageTitle: ' ',
url: 'web.js',
params: {
url: text,
browser: true,
showProgress: true,
url: text
},
});
}

View File

@ -3808,7 +3808,6 @@ export default {
url: 'web.js',
params: {
titleFixed: true,
allowAccess: true,
url: $A.urlReplaceHash(path)
},
})

View File

@ -201,7 +201,6 @@ export default {
url: 'web.js',
params: {
titleFixed: true,
allowAccess: true,
url: $A.urlReplaceHash(path)
},
})

View File

@ -235,7 +235,6 @@ export default {
pageTitle: this.$L(title),
url: 'web.js',
params: {
allowAccess: true,
url: $A.urlReplaceHash(path)
},
})

View File

@ -188,7 +188,6 @@ export default {
url: 'web.js',
params: {
titleFixed: true,
allowAccess: true,
url: $A.urlReplaceHash(path)
},
})

View File

@ -1927,7 +1927,6 @@ export default {
url: 'web.js',
params: {
titleFixed: true,
allowAccess: true,
url: $A.urlReplaceHash(path)
},
});

View File

@ -1145,7 +1145,6 @@ export default {
url: 'web.js',
params: {
titleFixed: true,
allowAccess: true,
url: $A.urlReplaceHash(path)
},
});

View File

@ -188,11 +188,7 @@ export default {
pageType: 'app',
pageTitle: ' ',
url: 'web.js',
params: {
url,
browser: true,
showProgress: true,
},
params: {url},
});
} else {
window.open(url)

View File

@ -1194,6 +1194,21 @@ export default {
*/
userUrl({state}, url) {
return new Promise(resolve => {
// 如果是访问:服务器域名 且 当前是本地文件,则将服务器域名替换成本地路径
if ($A.getDomain(url) == $A.getDomain($A.mainUrl()) && window.location.protocol == "file:") {
try {
const remoteURL = new URL(url)
if (/^\/(single|meeting)\//.test(remoteURL.pathname)) {
// 判断将服务器域名替换成本地路径
const localURL = new URL(window.location)
localURL.hash = remoteURL.pathname + remoteURL.search
return resolve(localURL.toString())
}
} catch (e) {
// 解析失败则不做任何处理
}
}
// 基本参数
const params = {
language: languageName,
@ -1235,7 +1250,6 @@ export default {
url: 'web.js',
params: {
titleFixed: true,
allowAccess: true,
hiddenDone: true,
url
},
@ -1259,6 +1273,16 @@ export default {
*/
async openAppChildPage({dispatch}, objects) {
objects.params.url = await dispatch("userUrl", objects.params.url)
if (typeof objects.params.allowAccess === "undefined") {
// 如果是本地文件,则允许跨域
objects.params.allowAccess = $A.getProtocol(objects.params.url) == "file:"
}
if (typeof objects.params.showProgress === "undefined") {
// 如果不是本地文件,则显示进度条
objects.params.showProgress = $A.getProtocol(objects.params.url) != "file:"
}
$A.eeuiAppOpenPage(objects)
},

@ -1 +1 @@
Subproject commit c40f8b16e992581c280760a082c1f6f56653c380
Subproject commit ca3803c8f27b96a955585a042102621249e08392