From 1f78d1aa9a1516d9d7f78cd686af119eb37260a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Wed, 16 Oct 2024 14:56:08 +0800 Subject: [PATCH] =?UTF-8?q?hiagent=E7=99=BB=E5=BD=95=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=9C=B0=E5=9D=80=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/iframe.jsx | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/forge/iframe.jsx b/src/forge/iframe.jsx index 26cdd8897..469aa808c 100644 --- a/src/forge/iframe.jsx +++ b/src/forge/iframe.jsx @@ -7,28 +7,24 @@ import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC"; const Iframe = (props) => { - const history = props.history - const location = history.location + const { history, showLoginDialog, current_user } = props + let settings = localStorage.chromesetting && localStorage.chromesetting !== 'undefined' &&JSON.parse(localStorage.chromesetting); - // if (!location.state.url) { - // history.push("/404"); - // } + useEffect(() => { + if (!settings?.common?.hiAgent) { + history.push("/404"); + } + if (!current_user?.login) { + history.push("/login?go_page=/hiagent"); + } + }, []) - function iframeLoad() { - let myIframe = document.getElementById("iframe"); - // if (myIframe.contentWindow.location && myIframe.contentWindow.location.href) { - // window.location.href = 'http://118.145.132.196:3000/product/llm/llm-chat' - // //myIframe.contentWindow.location.href - // } - } - - return + src={ settings?.common?.hiAgent } + > : '' } export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Iframe)))); \ No newline at end of file