This commit is contained in:
Archer
2023-10-23 15:05:13 +08:00
committed by GitHub
parent d37433eacd
commit bf6dbfb245
9 changed files with 61 additions and 38 deletions

View File

@@ -45,8 +45,16 @@ function App({ Component, pageProps }: AppProps) {
// get init data
(async () => {
const {
feConfigs: { scripts }
feConfigs: { scripts, isPlus }
} = await clientInitData();
// log fastgpt
!isPlus &&
console.log(
'%cWelcome to FastGPT',
'font-family:Arial; color:#3370ff ; font-size:18px; font-weight:bold;',
`GitHubhttps://github.com/labring/FastGPT`
);
setScripts(scripts || []);
})();
// add window error track
@@ -61,12 +69,7 @@ function App({ Component, pageProps }: AppProps) {
url
});
};
// log fastgpt
console.log(
'%cWelcome to FastGPT',
'font-family:Arial; color:#3370ff ; font-size:18px; font-weight:bold;',
`GitHubhttps://github.com/labring/FastGPT`
);
return () => {
window.onerror = null;
};

View File

@@ -166,7 +166,10 @@ const OutLink = ({
});
useEffect(() => {
setIdEmbed(window !== parent);
if (window !== top) {
window.top?.postMessage({ type: 'shareChatReady' }, '*');
}
setIdEmbed(window !== top);
}, []);
return (
@@ -280,7 +283,13 @@ export async function getServerSideProps(context: any) {
const authToken = context?.query?.authToken || '';
return {
props: { shareId, chatId, showHistory, authToken, ...(await serviceSideProps(context)) }
props: {
shareId,
chatId,
showHistory,
authToken,
...(await serviceSideProps(context))
}
};
}