forked from Gitlink/forgeplus-react
Merge pull request '漏洞' (#590) from Eeeros/forgeplus-react:pre_dev_military into pre_dev_military
This commit is contained in:
commit
9dd9b343aa
|
|
@ -32,7 +32,7 @@ function openTerminal(options) {
|
|||
console.log(data);
|
||||
client.sendClientData(data);
|
||||
|
||||
window.parent.postMessage({ tp: 'sshWorking' }, "*");
|
||||
window.parent.postMessage({ tp: 'sshWorking' }, window.location.origin);
|
||||
});
|
||||
term.open();
|
||||
$('body>.terminal').detach().appendTo(parentDomId + ' #term');
|
||||
|
|
@ -66,6 +66,7 @@ function openTerminal(options) {
|
|||
};
|
||||
|
||||
window.addEventListener("message", function (event) {
|
||||
if (event.origin !== window.location.origin) return
|
||||
console.log("post message: ");
|
||||
console.log(event.data);
|
||||
if (event.data.tp === 'resize') {
|
||||
|
|
@ -106,7 +107,7 @@ function openTerminal(options) {
|
|||
}
|
||||
if (force_close_socket === false) {
|
||||
// $(window).trigger('setSSHConnectStatus');
|
||||
window.parent.postMessage({ tp: 'setSSHConnectStatus', tab: options.tab }, "*");
|
||||
window.parent.postMessage({ tp: 'setSSHConnectStatus', tab: options.tab }, window.location.origin);
|
||||
} else {
|
||||
// 主动关闭连接时,不自动重连
|
||||
force_close_socket = false;
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ function JupyterTPI (props) {
|
|||
const addEventListeners = () => {
|
||||
window.addEventListener('message', (e) => {
|
||||
// console.log("触发了jupytermessage");
|
||||
if(e){
|
||||
if(e && e.origin === window.location.origin){
|
||||
if(e.data){
|
||||
if(e.data==="jupytermessage"){
|
||||
newHandle()
|
||||
|
|
@ -127,9 +127,9 @@ function JupyterTPI (props) {
|
|||
return;
|
||||
}
|
||||
if(sum===1){
|
||||
_iframe.contentWindow.postMessage("stopParent", "*");
|
||||
_iframe.contentWindow.postMessage("stopParent", window.location.origin);
|
||||
}else{
|
||||
_iframe.contentWindow.postMessage("clonsParent", "*");
|
||||
_iframe.contentWindow.postMessage("clonsParent", window.location.origin);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ class Challengesjupyter extends Component {
|
|||
|
||||
|
||||
window.addEventListener('message', (e) => {
|
||||
if(e){
|
||||
if(e && e.origin === window.location.origin){
|
||||
if(e.data){
|
||||
if(e.data==="jupytermessage"){
|
||||
if(this.state.showtime===false){
|
||||
|
|
|
|||
Loading…
Reference in New Issue