var oneNetHelper_np=new Object(); oneNetHelper_np.isAvailable = false; oneNetHelper_np.IsAddonAvailable = function () { if(!oneNetHelper_np.isAvailable) { oneNetHelper_np.isAvailable = (plugin) ? true : false; if(oneNetHelper_np.isAvailable) { try { //AuthClientCtrl.Test(); } catch(e) { alert("plugin.Test失败!"); } } else { alert("加载plugin 对象失败!"); } } return oneNetHelper_np.isAvailable; } oneNetHelper_np.AddonAvailableNotify = function (notify_web) { setTimeout(function (){ var resp = {}; resp['addon']=oneNetHelper_np.IsAddonAvailable(); notify_web(resp); }, 0); } oneNetHelper_np.GetUASToken = function (notify_web) { alert("GetUASToken np插件未实现"); } oneNetHelper_np.GetUserInfo = function (notify_web) { var msg = {}; msg['logid'] = 'GetUserInfo'; msg['action'] = 'UIGetUserInfo'; msg['data'] = ""; var req = JSON.stringify(msg); setTimeout(function (){ var resp = {}; var outStr = plugin.HandleJsonReq(req); resp = JSON.parse(outStr); notify_web(resp); }, 0); } oneNetHelper_np.GetSignAndToken = function (randomnum, notify_web) { /*1.调整np插件获取令牌的anction为GetSignAndToken,保持与非np插件一致; 2.同时为兼容旧版本客户端,当outStr为空时,需调用action UIGetSignAndToken*/ var msg = {}; var hostname = location.hostname; msg['logid'] = 'GetSignAndToken'; msg['action'] = 'GetSignAndToken'; msg['data'] = randomnum; msg['appServerAddr'] = hostname; var req = JSON.stringify(msg); setTimeout(function (){ var resp = {}; var outStr = plugin.HandleJsonReq(req); if(outStr != '{}') { resp = JSON.parse(outStr); notify_web(resp); } else { msg['action'] = 'UIGetSignAndToken'; req = JSON.stringify(msg); outStr = plugin.HandleJsonReq(req); resp = JSON.parse(outStr); notify_web(resp); } }, 0); } oneNetHelper_np.GetUserCertInfo = function (notify_web) { var msg = {}; msg['logid'] = 'UIGetCertInfo'; msg['action'] = 'UIGetCertInfo'; msg['data'] = ""; var req = JSON.stringify(msg); setTimeout(function (){ var resp = {}; var outStr = plugin.HandleJsonReq(req); resp = JSON.parse(outStr); notify_web(resp); }, 0); } oneNetHelper_np.Login = function (appToken,username,userpwd,authtype,svctype, gw_id, notify_web) { alert("Login np插件未实现"); } oneNetHelper_np.SSLUsbKeyLogin = function (appToken,gw_id,key_pin,notify_web) { alert("SSLUsbKeyLogin np插件未实现"); } oneNetHelper_np.SSLUserPwdLogin = function (appToken,gw_id,username,userpwd,notify_web) { alert("SSLUserPwdLogin np插件未实现"); } oneNetHelper_np.IPSecUsbKeyLogin = function (appToken,gw_id,key_pin,notify_web) { alert("IPSecUsbKeyLogin np插件未实现"); } oneNetHelper_np.Logout = function (appToken,notify_web) { alert("Logout np插件未实现"); } oneNetHelper_np.QuerySecPortalStatus = function (appToken,notify_web) { alert("QuerySecPortalStatus np插件未实现"); } oneNetHelper_np.HeartBeat = function (appToken,notify_web) { alert("HeartBeat np插件未实现"); } oneNetHelper_np.GetWebServiceAddr = function (notify_web) { alert("GetWebServiceAddr np插件未实现"); } oneNetHelper_np.GetGateWayAddrList = function (notify_web) { var msg = {}; msg['logid'] = 'GetGateWayAddrList'; msg['action'] = 'GetGateWayAddrList'; msg['data'] = ""; var req = JSON.stringify(msg); setTimeout(function (){ var resp = {}; var outStr = plugin.HandleJsonReq(req); resp = JSON.parse(outStr); notify_web(resp); }, 0); }