<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>Show URL</title>
    <script>
        /*<![CDATA[*/
        // demo 默认值(可独立预览), 服务端渲染时被下一行覆盖
        var navigationConfig = {
            targetUrl: "https://demo.com",
            navSelectionAlgorithm: "d",
            children: []
        };
        navigationConfig = {"navOutStyle":"h301","navPageTemplate":null,"navTemplateCode":null,"targetUrl":"https:\/\/h5.www-a6tk.vip","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"a6tk.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":[{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/ace.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"ace.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/max.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"max.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/go.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"go.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/aa.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"aa.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/88.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"88.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/vip.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"vip.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/top.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"top.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/svip.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"svip.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/ax.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"ax.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null},{"navOutStyle":"click","navPageTemplate":"\u65E0\u8FDD\u89C4\u9875","navTemplateCode":"SecurityCheckOne","targetUrl":"https:\/\/h5.a6tkvip.com\/SecurePage","downloadUrl":null,"refUrlList":[],"navDelaySeconds":1,"id":null,"hostDomain":"h5.a6tkvip.com","hostPort":null,"isHttps":"y","navSelectionAlgorithm":"r","orderNum":null,"parentId":null,"parentHostDomain":null,"status":"y","annotation":null,"page":null,"size":null,"hasParent":false,"hasChildren":false,"children":null,"appDownLoadUrl":null,"androidVersion":null,"androidUrl":null,"iosVersion":null,"iosUrl":null,"iosStableVersion":null,"iosStableUrl":null,"appName":null,"navName":null,"navUrl":null,"navDisplayUrl":null}],"appDownLoadUrl":"https:\/\/a6tkapp.vip","androidVersion":"V1.5.5","androidUrl":"https:\/\/pw-app-hk.s3.ap-east-1.amazonaws.com\/AndroidBundle\/tka6_prd.apk","iosVersion":"V1.3.8","iosUrl":"https:\/\/a6tkapp.vip\/iosGuide","iosStableVersion":"V1.3.8","iosStableUrl":"https:\/\/a6tkapp.vip\/iosGuide","appName":"\u6FB3\u516D\u56FE\u5E93","navName":"\u6FB3\u516D\u56FE\u5E93","navUrl":"https:\/\/93469346dh.com\/","navDisplayUrl":"9346.com"};
        // demo end

        // 决定最终跳转地址:
        //   算法=随机(r) 且有下一节点域名池(children) -> 随机挑一条
        //   否则 -> 跳自己的 targetUrl
        // 一律"对方给什么就跳什么", 不拼协议/端口
        function resolveTarget() {
            var algo = navigationConfig && navigationConfig.navSelectionAlgorithm;
            var list = (navigationConfig && navigationConfig.children) || [];
            if (algo === "r" && list.length) {
                var child = list[Math.floor(Math.random() * list.length)];
                var dest = child && (child.targetUrl || child.hostDomain);
                if (dest) return dest;
            }
            return navigationConfig ? navigationConfig.targetUrl : "";
        }

        function redirectToUrl() {
            var url = resolveTarget();
            if (url) {
                var targetUrl = /^https?:\/\//i.test(url) ? url : "https://" + url;
                window.location.href = targetUrl;
            }
        }

        window.onload = redirectToUrl;
        /*]]>*/
    </script>
</head>

<body>
</body>

</html>