HTML域名授权打开源码

陈晓
2025-04-23 / 0 评论 / 5 阅读 / 正在检测是否收录...

HTML域名授权打开源码
配合JS加密使用吧授权js加密起来 :https://y.js.cn/

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>域名验证示例</title>
    <style>
        #authorizedContent, #unauthorizedContent {
            display: none;
        }
    </style>
</head>
<body>
    <div id="authorizedContent">
        <h1>欢迎访问!</h1>
        <p>您已获得授权访问此页面。</p>
    </div>
    
    <div id="unauthorizedContent">
        <h1>错误:程序未授权</h1>
        <p>您当前访问的域名未获得授权。</p>
    </div>

    <script>
        // 指定授权域名
        var allowedDomains = ["example.com", "www.example.com"];

        // 获取当前域名
        var currentDomain = window.location.hostname;

        // 检查当前域名是否在授权列表中
        if (allowedDomains.includes(currentDomain)) {
            document.getElementById('authorizedContent').style.display = 'block';
        } else {
            document.getElementById('unauthorizedContent').style.display = 'block';
        }
    </script>
</body>
</html>
0

评论 (0)

取消
网站已运行 00000000

Powered by Typecho ※ Theme is RST网络


CDN Sponsor Server provider Google Analytics Google Analytics
桂ICP备18006850号-1