Perry
管理员
管理员
  • 发帖数213
  • QQ396572376
  • 金币41470两
  • 威望11348点
  • 钻石8888枚
  • 注册日期2016-11-09
  • 最后登录2024-04-25
  • VIP会员
  • 荣誉会员
  • 优秀斑竹
  • 最爱沙发
  • 原创写手
  • 社区居民
阅读:22028回复:10

网页登录系统时,无需点击内网外网登录,直接判断~

楼主#
更多 发布于:2016-11-11 17:34
常常我们在登录网页后,还要弹个窗口提示点击内网登录与外网登录,我写的网页,网页可直接判断是否为内网还是外网,并且直接登录,并且自动设置好安全等级等信息。如果内网不能访问外部ip,具体位置可以调整下,具体效果慢慢体验吧~~~~

请以root权限 到 /var/www/html 下更改tiptop.html 内容
请注意备份哦~~
<!--   
 FOURJS_START_COPYRIGHT(D,2002) Property of Four Js*  
 (c) Copyright Four Js 2002, 2012. All Rights Reserved.  
 * Trademark of Four Js Development Tools Europe Ltd  
   in the United States and elsewhere    
 This file can be modified by licensees according to the  
 product manual. FOURJS_END_COPYRIGHT--><HTML>  
  <HEAD>    <TITLE>  
      TOPGP ERP管理系统客户端服务程序  
    </TITLE>  
    <META http-equiv="expires" content="1">  
    <META http-equiv="pragma" content="no-cache">  
    <style>.divcss-right{float:left;width:150px;height:25px;border:1px solid #F00}</style>  
  </HEAD>  
  <BODY BGCOLOR="#FFFFFF" onload="startIt();" onbeforeunload="preventClose();">  
    <H2 style="color:#FF0000">  
      系统开启后请勿关闭此界面,关闭将自动退出所有系统页面,若长时间无法打开,请下载桌面客户端安装!  
    </H2>   
    <CENTER>  
      <DIV id="divgdc" style="display:none"></DIV>  
      <DIV id="divwait">  
        正在安装系统客户端插件请稍后...  
        安装过程可能需要几分钟时间,取决于您的网速.  
        如果您的IE浏览器警告 Active X 安全问题, 请选择允许安装.若长时间无响应,请设置浏览器为兼容模式
             
             
        <IMG src="/gas/pic/processing.gif"/>  
             
      </DIV>  
    </CENTER>  </BODY>  
     
  <SCRIPT src="/gas/fjs/activex/fglgdcdefault.js"></SCRIPT>  
  <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>  
  <SCRIPT language="javascript">  
    var timerID = 0;    var gdc = 0;  
    var retryCount = 0;  
    var maxRetry = 240; //the script will test if GDC is loaded for 240 seconds  
     function startIt() {  
      // first activate ActiveX.  
      gdc = loadGDC("divgdc", "GeneroDesktopClient", "2,40,21,0", "gas");  
      checkGDC();    }   
    function preventClose() {  
        if ( !gdc ) {  
         return;  
        }   
       if (gdc.applicationCount > 0) {  
        event.returnValue = "Genero Desktop Client";  
       }    }   
    function configureGDC() {   
      gdc.setAdmin(true);  
      gdc.setListeningMode("any");   
      gdc.setDebug(true);   
      gdc.setFocus();    }  
     
    function startApplication(appName, appQueryString) {  
         
      gdc.setSrvUrl(location.protocol + "//" + location.host + "/gas/wa/r/" + appName);  
      gdc.setPictureUrl("$(pictures.uri)");  
      gdc.setAppName(appName);   
      return false;    }   
    function checkGDC(){  
       if(timerID) {  
          clearTimeout(timerID);  
          timerID  = 0;  
       }   
      if (!gdc || !gdc.enabled) {  
        // gdc is not ready, wait a few seconds...  
        retryCount++;  
        if (retryCount <= maxRetry) {  
          timerID = setTimeout("checkGDC()", 1000);  
        } else {  
                    if (confirm("系统客户端启动超时.\n是否继续等待 ?")){  
                      retryCount = 0;  
            timerID = setTimeout("checkGDC()", 1000);  
            return;  
                    }  
          document.getElementById("divwait").style.display = 'none';  
          document.getElementById("divgdc").style.display = 'block';  
          document.getElementById("divlogin").style.display = 'none';  
          alert("系统客户端无法启动, 请联系系统管理员.");  
        }  
      }      else {  
        document.getElementById("divwait").style.display = 'none';  
        document.getElementById("divgdc").style.display = 'block';  
        document.getElementById("divlogin").style.display = 'block';  
        configureGDC();  
        if(returnCitySN["cip"] == "xxx.xxx.xxx.xxx")  //公司对应的外网ip  
        {  
             //alert(returnCitySN["cip"]);  
             return startApplication("gdc-tiptop-udm-intranet", "$(application.querystring)");//内网  
        }  
        else  
        {  
             //alert(returnCitySN["cip"]);  
             return startApplication("gdc-tiptop-udm-internet", "$(application.querystring)");//外网  
        }  
            
      }    }   
</SCRIPT>  </HTML>
喜欢2 评分0

最新喜欢:

LocustLocust toy3536toy353...
官方QQ群:556775727  
游客

返回顶部