Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
nitsc authored Jul 2, 2024
1 parent 10d57cd commit bb4fa99
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,6 @@ <h2></h2>
<h2></h2>
<h5>如果你想加入NITSC,你需要有一点或更多的计算机或编程知识。NITSC QQ 地址: 875026309</h5>

// 记录访客IP的函数
function recordVisitorIP() {
// 获取访客的IP地址(这里简化为示例IP)
var visitorIP = '192.168.0.1'; // 在实际生产环境中需要使用真实获取IP的方法

// 将IP地址存储到localStorage中
var visitedIPs = JSON.parse(localStorage.getItem('visitedIPs')) || [];
visitedIPs.push(visitorIP);
localStorage.setItem('visitedIPs', JSON.stringify(visitedIPs));
}

// 查看记录的IP函数(需要管理员密码)
function viewRecordedIPs(password) {
// 这里假设密码为 '147258369qazwsx'
if (password === '147258369qazwsx') {
var visitedIPs = JSON.parse(localStorage.getItem('visitedIPs')) || [];
console.log('记录的IP地址:', visiter_IPs);
// 在实际应用中,可以将记录展示在页面上或进行其他处理
} else {
console.log('密码错误,无法查看记录的IP地址。');
}
}

// 示例使用:
// 记录访客IP(通常可以在页面加载时调用)
recordVisitorIP();

// 查看记录的IP地址(管理员功能,需要输入正确的密码)
viewRecordedIPs('admin');


<h6>2024 Copyright© NITSC, Dean of NITSC, 周** </h6>
</body>
Expand Down

0 comments on commit bb4fa99

Please sign in to comment.