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