增加urlprotocol处理

增加urlprotocol处理
pull/124/head
horizonlin 2018-12-11 14:37:57 +08:00 committed by GitHub
parent 3a669310bf
commit 9b9e8b871a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 18 deletions

View File

@ -121,6 +121,15 @@ $assist.do_teleport = function (args, func_success, func_error) {
// console.log('---', data);
var args_ = encodeURIComponent(JSON.stringify(data));
//判断是否使用urlprocotol处理方式
if ($app.options.url_proto){
if(!$("#urlproto").length) {
var _html = "<div id='urlproto' style='display:none;z-index=-1;'><iframe src=''/></div>";
$('body').append($(_html));
}
$("#urlproto").find("iframe").attr("src",'teleport://' + JSON.stringify(data));
}else{
$.ajax({
type: 'GET',
timeout: 5000,
@ -140,6 +149,7 @@ $assist.do_teleport = function (args, func_success, func_error) {
func_error(TPE_NO_ASSIST, '无法连接到teleport助手可能尚未启动');
}
});
}
} else {
if (ret.code === TPE_NO_CORE_SERVER) {
func_error(ret.code, '远程连接请求失败可能teleport核心服务尚未启动' + ret.message);