diff --git a/src/App.js b/src/App.js index 13a1f85fa..74c1fcbab 100644 --- a/src/App.js +++ b/src/App.js @@ -165,7 +165,7 @@ const Iframe = Loadable({ }); // 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。 -const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone"]; +const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "hiagent"]; class App extends Component { constructor(props) { diff --git a/src/forge/iframe.jsx b/src/forge/iframe.jsx index f7b6ef56e..469aa808c 100644 --- a/src/forge/iframe.jsx +++ b/src/forge/iframe.jsx @@ -7,30 +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"); - myIframe.height = `${document.documentElement.clientHeight - 473 + 86}px` - // if (myIframe.contentWindow.location && myIfram e.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 diff --git a/src/index.css b/src/index.css index 452f0f91b..7f853f7d9 100644 --- a/src/index.css +++ b/src/index.css @@ -253,4 +253,5 @@ i.color-orange05:hover { .test-iframe { margin-top: -48px; vertical-align:bottom; + height: 100vh; } \ No newline at end of file