From 72cfc91e5f71f954baf615272261ee33cf737f6e Mon Sep 17 00:00:00 2001 From: wjh Date: Mon, 2 Sep 2024 16:58:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=9A=E5=BA=94=E7=94=A8=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E8=B7=B3=E8=BD=AC=E8=B7=AF=E5=BE=84=E4=B8=8D=E5=AF=B9?= =?UTF-8?q?=20(#1501)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1501 Co-authored-by: wjh Co-committed-by: wjh --- .../core/client/src/schema-component/antd/grid-card/hooks.ts | 2 +- .../plugin-mobile-client/src/client/router/OpenInNewTab.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/grid-card/hooks.ts b/packages/core/client/src/schema-component/antd/grid-card/hooks.ts index e8ef5db93..f66305dec 100644 --- a/packages/core/client/src/schema-component/antd/grid-card/hooks.ts +++ b/packages/core/client/src/schema-component/antd/grid-card/hooks.ts @@ -26,7 +26,7 @@ export const useGridCustomPageUrl = ({ field, fieldSchema }) => { fieldSchema?.parent?.parent?.['x-decorator-props']?.['linkConfig'] || {}; const { record } = field; let options = '?'; - fields.forEach((item, index) => { + fields?.forEach((item, index) => { if (!record[item]) return; return (options += `${index === 0 ? '' : '&'}${item}=${record[item]}`); }); diff --git a/packages/plugins/@tachybase/plugin-mobile-client/src/client/router/OpenInNewTab.tsx b/packages/plugins/@tachybase/plugin-mobile-client/src/client/router/OpenInNewTab.tsx index e39869daf..6130d25af 100644 --- a/packages/plugins/@tachybase/plugin-mobile-client/src/client/router/OpenInNewTab.tsx +++ b/packages/plugins/@tachybase/plugin-mobile-client/src/client/router/OpenInNewTab.tsx @@ -11,7 +11,9 @@ export const OpenInNewTab = () => { const app = useApp(); const onOpenInNewTab = () => { - window.open(app.getRouteUrl('/mobile')); + const search = window.location; + const hash = search.hash.slice(search.hash.indexOf('/')); + window.open(app.getRouteUrl(hash)); }; return (