fix: share page load title error (#3111)

This commit is contained in:
Archer
2024-11-11 10:13:45 +08:00
committed by archer
parent 0201e63cfd
commit acdf6a0dd9
3 changed files with 13 additions and 10 deletions

View File

@@ -40,3 +40,4 @@ weight: 811
15. 优化 - 语音播报,不支持 mediaSource 的浏览器可等待完全生成语音后输出。 15. 优化 - 语音播报,不支持 mediaSource 的浏览器可等待完全生成语音后输出。
16. 修复 - Dockerfile pnpm install 支持代理。 16. 修复 - Dockerfile pnpm install 支持代理。
17. 修复 - BI 图表生成无法写入文件。 17. 修复 - BI 图表生成无法写入文件。
18. 修复 - 分享链接首次加载时,标题显示不正确。

View File

@@ -147,7 +147,6 @@ const MyMenu = ({
position={'relative'} position={'relative'}
color={isOpen ? 'primary.600' : ''} color={isOpen ? 'primary.600' : ''}
w="fit-content" w="fit-content"
p="1"
h="fit-content" h="fit-content"
borderRadius="sm" borderRadius="sm"
> >

View File

@@ -44,13 +44,14 @@ type Props = {
customUid: string; customUid: string;
}; };
const OutLink = ({ const OutLink = (
outLinkUid props: Props & {
}: Props & { outLinkUid: string;
outLinkUid: string; }
}) => { ) => {
const { t } = useTranslation(); const { t } = useTranslation();
const router = useRouter(); const router = useRouter();
const { outLinkUid } = props;
const { const {
shareId = '', shareId = '',
chatId = '', chatId = '',
@@ -297,6 +298,7 @@ const OutLink = ({
return ( return (
<> <>
<NextHead title={props.appName || 'AI'} desc={props.appIntro} icon={props.appAvatar} />
<PageContainer <PageContainer
isLoading={loading} isLoading={loading}
{...(isEmbed {...(isEmbed
@@ -388,11 +390,12 @@ const Render = (props: Props) => {
return ( return (
<> <>
<NextHead title={props.appName || 'AI'} desc={props.appIntro} icon={props.appAvatar} /> {systemLoaded ? (
{systemLoaded && (
<ChatContextProvider params={contextParams}> <ChatContextProvider params={contextParams}>
<OutLink {...props} outLinkUid={contextParams.outLinkUid} />; <OutLink {...props} outLinkUid={contextParams.outLinkUid} />;
</ChatContextProvider> </ChatContextProvider>
) : (
<NextHead title="Loading..." />
)} )}
</> </>
); );
@@ -425,9 +428,9 @@ export async function getServerSideProps(context: any) {
return { return {
props: { props: {
appName: app?.appId?.name ?? 'name', appName: app?.appId?.name ?? 'AI',
appAvatar: app?.appId?.avatar ?? '', appAvatar: app?.appId?.avatar ?? '',
appIntro: app?.appId?.intro ?? 'intro', appIntro: app?.appId?.intro ?? 'AI',
shareId: shareId ?? '', shareId: shareId ?? '',
authToken: authToken ?? '', authToken: authToken ?? '',
customUid, customUid,