From 40f5ba5004d06dbbbda377f3c2584edb25fcd738 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 29 Jun 2025 21:08:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- resources/assets/js/store/actions.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2374d8710..ce1a5081c 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index 476a7b0ed..2d7f2bc80 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -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); },