1 Star 0 Fork 3.7K

jiujiu / spider-flow

forked from ssssssss-team / spider-flow
关闭
 
 / 详情

spider-web 设置上下文根后, 调试页面socket错误的问题

已完成
拥有者
创建于  
2021-01-19 17:32

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;
}

评论 (0)

jiujiu 创建了任务
jiujiu 关联仓库设置为黄笑寒/spider-flow
jiujiu 任务状态待办的 修改为进行中
jiujiu 任务状态进行中 修改为待办的
jiujiu 任务状态待办的 修改为进行中
jiujiu 任务状态进行中 修改为待办的
jiujiu 任务状态待办的 修改为进行中
jiujiu 关联分支设置为dev
jiujiu 任务状态进行中 修改为待办的
jiujiu 任务状态待办的 修改为已完成
jiujiu 负责人设置为jiujiu
展开全部操作日志

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(1)
Java
1
https://gitee.com/huangxiaohan1117/spider-flow.git
git@gitee.com:huangxiaohan1117/spider-flow.git
huangxiaohan1117
spider-flow
spider-flow

搜索帮助