fix: 多应用预览跳转路径不对 (#1501)

Reviewed-on: daoyoucloud/tachybase#1501
Co-authored-by: wjh <wwwjh0710@163.com>
Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
wjh 2024-09-02 16:58:56 +08:00 committed by bai.zixv
parent 5d51d312dc
commit 72cfc91e5f
2 changed files with 4 additions and 2 deletions

View File

@ -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]}`);
});

View File

@ -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 (