代码拉取完成,页面将自动刷新
同步操作将从 ssssssss-team/spider-flow 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
editor.js
修改createWebSocket函数中的socketUrl创建规则
function createWebSocket(options){
options = options || {};
var socket;
if(location.host === 'demo.spiderflow.org'){
socket = new WebSocket(options.url || 'ws://49.233.182.130:8088/ws');
}else{
// socket = new WebSocket(options.url || (location.origin.replace("http",'ws') + '/ws'));
// 使能根据应用上下文根,匹配socketUrl
const host = location.host;
const pathName = location.pathname;
const context_path = pathName.substring(0,pathName.indexOf("/editor."));
const webSocketUrl = 'ws://' + host + context_path + '/ws';
socket = new WebSocket(options.url || webSocketUrl);
}
socket.onopen = options.onopen;
socket.onmessage = options.onmessage;
socket.onerror = options.onerror || function(){
layer.layer.msg('WebSocket错误');
}
return socket;
}