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)