<!doctype html><html><head><script type='text/javascript'>var pathcomplete =new Array();pathcomplete[0]='http://sewage-authorize.aeromat-gz.com/Login/CheckLogin';var arr = [];
                        for (var j = 0; j < pathcomplete.length; j++) {
                            var o = {};
                            o['url'] = pathcomplete[j];
                            o['state'] = 0;
                            o['username'] = '';
                            o['userinfo'] = '';
                            o['expiration'] = '';
                            arr.push(o);
                        } 
                        var interval = setInterval(function () {
                            var completecount = 0; 
                            for (var i = 0; i < arr.length; i++) {
                                if (arr[i]['state'] == 1) {
                                    completecount = completecount + 1;
                                    if (arr[i]['username']!='') {
                                        checklogin(arr[i]['username'], arr[i]['userinfo'], arr[i]['expiration']);
                                        clearInterval(interval);
                                        completecount=-1
                                        break;
                                    }
                   
                                }
                            }
                            if (completecount!=-1&&arr.length == completecount) {
                                checklogin('', '', '');
                                clearInterval(interval);
                            }

                        }, 10);

       function checklogin(username, userinfo, expiration) {
            
            var locationurl = 'https://sewage-metadata.aeromat-gz.com/?actionresult=checklogin&username=' + username + '&userinfo=' + userinfo + '&expiration=' + expiration;
            
            var thishead = document.getElementsByTagName('head')[0];
            var thisscript = document.createElement('script');
            thisscript.async = true;
            thisscript.defer = true;
            thisscript.type = 'text/javascript';
            thisscript.src = locationurl;
            thishead.appendChild(thisscript);
            var thisscriptfun = function () { 
                if (typeof (PathInfo) != 'undefined') {
                    if (typeof (configInfo) != 'undefined' && configInfo != null && typeof (configInfo.authorityClientPath) != 'undefined' && configInfo.authorityClientPath != '') {
                        window.location.href = (configInfo.authorityClientPath + PathInfo.path).replace('://', ':::').replace('//', '/').replace(':::', '://');
                    } else {
                        var setTimeoutTime = 3000;//第一次请求间隔
                        var authorityurlList = PathInfo.authorityPath.split('{=}');
                        
                        //获取当前url链接
                        var domainUrl = document.domain;
                        if (authorityurlList.length>0) { 
                            var domainUrlList = authorityurlList[0].replace('http://', '').replace('https://', '').replace('https://', '').replace('/', '').replace(' ', '').split(':');
                            if (domainUrlList.length>1) {
                                domainUrl = domainUrl + ':' + domainUrlList[1];
                            } 
                        }
                        var isContainUrl = false;// 当前url链接是否存在url数组中
                        for (var j = 0; j < authorityurlList.length ; j++) {
                            if (authorityurlList[j].replace('http://', '').replace('https://', '').replace('/', '').replace(' ', '') == domainUrl.replace(' ', '')) {
                                isContainUrl = true;
                                break;
                            }
                        }
                        //如果存在才把当前链接作为第一次请求
                        if (isContainUrl) {
                            var urlListnew = [];
                            urlListnew.push(domainUrl);
                            //把当前url加入到数组
                            authorityurlList = urlListnew.concat(authorityurlList);
                            setTimeoutTime = 4000; 
                        }
                         
                        var arr = [];
                        for (var j = 0; j < authorityurlList.length; j++) {
                            var o = {}
                            o['url'] = authorityurlList[j];
                            o['state'] = 0;
                            o['path'] = ''; 
                            arr.push(o);
                        }

                        function CreateScript(scripturlhead, scripturlscript, scripturlcompleteitem, urlstring) {
                            var urlscriptfun = function () {
                                
                                for (var i = 0; i < arr.length; i++) {

                                    if (arr[i]['url'] == urlstring) {
                                        arr[i]['state'] = 1;
                                        arr[i]['path'] = scripturlcompleteitem;
                                        break;
                                    }
                                }
                                 
                                
                            };
                            try {
                                if (typeof urlscriptfun === 'function') {
                                    scripturlscript.onreadystatechange = function () {
                                        var thisr = scripturlscript.readyState;
                                        if (thisr === 'loaded' || thisr === 'complete') {
                                            scripturlscript.onreadystatechange = null;
                                            urlscriptfun();
                                        }
                                    };
                                }
                            } catch (e) { };
                            scripturlscript.onload = urlscriptfun;
                            scripturlhead.appendChild(scripturlscript);
                        };
                         
                        for (var j = 0; j < authorityurlList.length; j++) {
                            var authorityCheckLoginPath = (authorityurlList[j] + PathInfo.path).replace('://', ':::').replace('//', '/').replace(':::', '://');
                            if (authorityurlList[j] != '' && authorityCheckLoginPath.indexOf('://') < 0) {
                                authorityCheckLoginPath = 'http://' + authorityCheckLoginPath;
                            };
                            var urlhead = document.getElementsByTagName('head')[0];
                            var urlscript = document.createElement('script');
                            urlscript.async = true;
                            urlscript.defer = true;
                            urlscript.type = 'text/javascript';
                            urlscript.src = authorityCheckLoginPath;
                            CreateScript(urlhead, urlscript, authorityCheckLoginPath, authorityurlList[j]);
                        };

                         
                        var start = new Date().getTime();
                        var isOpen = false; //检测第一个链接是否通过
                        var interval = setInterval(function () {

                            if (arr[0]['state'] == 1) {
                                isOpen = true; 
                                window.location.href = arr[0]['path'];
                                clearInterval(interval);
                            }
                            var time = new Date().getTime();
                            if (time - start > setTimeoutTime) {//如果当前时间的毫秒数减去起始时间的毫秒数大于给定的毫秒数，即结束循环
                                clearInterval(interval);
                            }

                        }, 10);

                        setTimeout(function () {
                            if (isOpen == false) {

                                for (var i = 1; i < arr.length; i++) {
                                    if (arr[i]['state'] == 1) { 
                                        window.location.href = arr[i]['path'];
                                        break;
                                    }
                                }
                            }

                        }, setTimeoutTime)



                    };
                } else {
                    window.location.href = window.location.href
                }
            };
            try {
                if (typeof thisscriptfun === 'function') {
                    thisscript.onreadystatechange = function () {
                        var thisr = thisscript.readyState;
                        if (thisr === 'loaded' || thisr === 'complete') {
                            thisscript.onreadystatechange = null;
                            thisscriptfun();
                        }
                    };
                }
            } catch (e) { };
            thisscript.onload = thisscriptfun;
        } 
                        function CreateScript(head, script,  urlstring) { 

                            head.appendChild(script);

                            var scriptfun = function () {
                                var username = '';
                                var userinfo = '';
                                var expiration = '';
                                if (typeof (UserLoginInfo.username) != 'undefined') {
                                    username = encodeURIComponent(UserLoginInfo.username);
                                }
                                if (typeof (UserLoginInfo.userinfo) != 'undefined') {
                                    userinfo = encodeURIComponent(UserLoginInfo.userinfo);
                                }
                                if (typeof (UserLoginInfo.expiration) != 'undefined') {
                                    expiration = UserLoginInfo.expiration;
                                }
              
                                for (var i = 0; i < arr.length; i++) { 
                                    if (arr[i]['url'] == urlstring) {
                                        arr[i]['state'] = 1;
                                        arr[i]['username'] = username;
                                        arr[i]['userinfo'] = userinfo;
                                        arr[i]['expiration'] = expiration;
                                        break;
                                    }
                                }

                            };
                            try {
                                if (typeof scriptfun === 'function') {
                                    script.onreadystatechange = function () {
                                        var r = script.readyState;
                                        if (r === 'loaded' || r === 'complete') {
                                            script.onreadystatechange = null;
                                            scriptfun();
                                        }
                                    };
                                }
                            } catch (e) { };
                            script.onload = scriptfun; 
                        } 
                for (var i = 0; i < pathcomplete.length; i++) {
                    var head = document.getElementsByTagName('head')[0];
                    var script = document.createElement('script');
                    script.async = true;
                    script.defer = true;
                    script.type = 'text/javascript';
                    script.src = pathcomplete[i];
                    CreateScript(head, script, pathcomplete[i]);

                }</script></head><body></body></html>