Merge pull request 'hiagent' (#775) from gitlink_management into pre_gitlink_ssr

This commit is contained in:
Eeeros 2024-10-16 15:04:09 +08:00
commit 963eb57978
3 changed files with 15 additions and 20 deletions

View File

@ -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) {

View File

@ -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 <iframe
return current_user?.login ? <iframe
id="iframe"
width="100%"
height="800px"
className="test-iframe"
src={ 'http://118.145.132.196:3000/product/llm/llm-chat' }
onLoad={iframeLoad}
></iframe>
src={ settings?.common?.hiAgent }
></iframe> : ''
}
export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Iframe))));

View File

@ -253,4 +253,5 @@ i.color-orange05:hover {
.test-iframe {
margin-top: -48px;
vertical-align:bottom;
height: 100vh;
}