82 lines
1.7 KiB
JavaScript
82 lines
1.7 KiB
JavaScript
async function handleRequest(request) {
|
|
// ICP备案号
|
|
const icp = "ICP备案号";
|
|
|
|
// 公安备案号
|
|
const publicSecurity = "公安备案号";
|
|
|
|
// HTML页面
|
|
const html = `
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>小小的日记本</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 100vh;
|
|
background-color: #ffffff;
|
|
}
|
|
.main-content {
|
|
flex: 1;
|
|
}
|
|
.beian-footer {
|
|
background-color: #f5f5f5;
|
|
padding: 20px;
|
|
text-align: center;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
}
|
|
.beian-footer p {
|
|
margin: 0;
|
|
font-size: 14px;
|
|
color: #666;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: 20px;
|
|
flex-wrap: wrap;
|
|
}
|
|
a {
|
|
text-decoration: none;
|
|
color: #666;
|
|
}
|
|
a:hover {
|
|
color: #333;
|
|
}
|
|
.separator {
|
|
color: #999;
|
|
}
|
|
.beian-footer img {
|
|
height: 14px;
|
|
vertical-align: middle;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="main-content"></div>
|
|
<div class="beian-footer">
|
|
<p><a href="https://beian.miit.gov.cn/" target="_blank">${icp}</a> <span class="separator">|</span> <a href="https://beian.mps.gov.cn/" target="_blank"><img src="https://image.cloudyun.top/i/2026/02/09/o49mk.png" alt="公安备案" style="vertical-align: middle;"> ${publicSecurity}</a></p>
|
|
</div>
|
|
</body>
|
|
</html>`;
|
|
|
|
return new Response(html, {
|
|
status: 200,
|
|
headers: {
|
|
'Content-Type': 'text/html; charset=utf-8'
|
|
}
|
|
});
|
|
}
|
|
|
|
addEventListener('fetch', event => {
|
|
return event.respondWith(handleRequest(event.request));
|
|
});
|