相关优化、添加网页标题

This commit is contained in:
黄心宇 2024-10-25 14:51:31 +08:00
parent 963eb57978
commit 20b33fa134
1 changed files with 14 additions and 0 deletions

View File

@ -17,13 +17,27 @@ const Iframe = (props) => {
if (!current_user?.login) {
history.push("/login?go_page=/hiagent");
}
document.title = "GitLink-AI"
}, [])
function iframeLoad() {
let myIframe = document.getElementById("iframe");
const toastRight = myIframe?.contentWindow?.document?.getElementsByClassName("arco-notification-wrapper-topRight")[0]
const toastTop = myIframe?.contentWindow?.document?.getElementsByClassName("arco-notification-wrapper-top")[0]
if (toastRight) {
toastRight.style.top = '60px'
}
if (toastTop) {
toastTop.style.top = '80px'
}
}
return current_user?.login ? <iframe
id="iframe"
width="100%"
className="test-iframe"
src={ settings?.common?.hiAgent }
onLoad={iframeLoad}
></iframe> : ''
}