fix: 修复客户端无法打开部分应用的问题

This commit is contained in:
kuaifan 2025-06-29 21:08:14 +08:00
parent 32f30826b9
commit 40f5ba5004
2 changed files with 9 additions and 7 deletions

View File

@ -96,7 +96,7 @@ services:
appstore:
container_name: "dootask-appstore-${APP_ID}"
privileged: true
image: "dootask/appstore:0.1.2"
image: "dootask/appstore:0.1.3"
volumes:
- shared_data:/usr/share/dootask
- /var/run/docker.sock:/var/run/docker.sock

View File

@ -4679,15 +4679,17 @@ export default {
if (!data.id || !data.name || !data.url) {
return
}
const serverLocation = new URL($A.mainUrl(''))
data.url = data.url
.replace(/^\:(\d+)/ig, (_, port) => {
return window.location.protocol + '//' + window.location.hostname + ':' + port;
return serverLocation.protocol + '//' + serverLocation.hostname + ':' + port;
})
.replace(/\{window[._]location[._](\w+)}/ig, (_, property) => {
if (property in window.location) {
return window.location[property];
if (property in serverLocation) {
return serverLocation[property];
}
})
.replace(/\{system_base_url}/g, serverLocation.origin)
const config = {
id: data.id,
name: data.name,
@ -4703,14 +4705,14 @@ export default {
$A.modalWarning(`应用「${config.id}」未安装`);
return;
}
config.url = config.url.replace(/\{user_id}/g, state.userId)
config.url = config.url
.replace(/\{user_id}/g, state.userId)
.replace(/\{user_nickname}/g, encodeURIComponent(state.userInfo.nickname))
.replace(/\{user_email}/g, encodeURIComponent(state.userInfo.email))
.replace(/\{user_avatar}/g, encodeURIComponent(state.userInfo.userimg))
.replace(/\{user_token}/g, encodeURIComponent(state.userToken))
.replace(/\{system_theme}/g, state.systemConfig.themeName)
.replace(/\{system_lang}/g, languageName)
.replace(/\{system_base_url}/g, $A.mainUrl('').replace(/\/$/, ''));
.replace(/\{system_lang}/g, languageName);
emitter.emit('observeMicroApp:open', config);
},