From c6caa7aadea4f4cb825a1b78323ef003869977c8 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 16 Mar 2021 14:37:24 +0800 Subject: [PATCH] fix: show site title in document title --- .../app/src/components/pages/AdminLoader/Page/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/app/src/components/pages/AdminLoader/Page/index.tsx b/packages/app/src/components/pages/AdminLoader/Page/index.tsx index 7bb06c211..7f5a0c164 100644 --- a/packages/app/src/components/pages/AdminLoader/Page/index.tsx +++ b/packages/app/src/components/pages/AdminLoader/Page/index.tsx @@ -3,7 +3,7 @@ import { PageHeader, Card, Row, Col, Modal, message } from 'antd'; import './style.less'; import { Helmet, useHistory } from 'umi'; import { Spin } from '@nocobase/client'; -import { useRequest, useLocation } from 'umi'; +import { useRequest, useModel } from 'umi'; import api from '@/api-client'; import View from '../View'; import get from 'lodash/get'; @@ -11,6 +11,8 @@ import { markdown } from '@/components/views/Field'; export function Page(props: any) { const { currentRowId, pageName, children, ...restProps } = props; + const { initialState = {}, refresh, setInitialState } = useModel('@@initialState'); + const siteTitle = get(initialState, 'systemSettings.title') || 'NocoBase'; const { data = {}, loading, error } = useRequest(() => api.resource('menus').getInfo({ resourceKey: pageName, @@ -33,7 +35,7 @@ export function Page(props: any) { return (
- {data.title} + {data.title} - {siteTitle}