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