备案信息添加维护说明 - 离线版
适用于“选择题训练系统 v2.0 在线 H5 扫码版”。
一、当前备案信息
- 网站名称:我的题库信息化处理
- 域名:hofor881.cn
- 工信部备案号:闽ICP备2026023379号
- 公安备案号:闽公网安备35012102550517号
二、涉及文件
public/beian-footer.js:统一生成备案底部信息。public/beian.png:公安备案图标。public/login.htmlpublic/teacher.htmlpublic/student.htmlpublic/help.htmlpublic/admin-guide.html
三、备案 HTML 内容
ICP备案链接:
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noreferrer">闽ICP备2026023379号</a>
公安备案链接:
<a href="https://beian.mps.gov.cn/#/query/webSearch?code=35012102550517" target="_blank" rel="noreferrer"> <img src="/beian.png" alt="公安备案图标"> 闽公网安备35012102550517号 </a>
四、推荐实现方式
使用公共脚本 public/beian-footer.js,所有页面只引入:
<script src="/beian-footer.js"></script>
好处:以后备案号、样式、链接变化时,只需要修改一个公共脚本。
五、关键注意事项
不要简单替换第一个
</body>。教师端和学生端页面里有 w.document.write(...</body></html>) 弹窗字符串,错误插入会破坏 JavaScript,导致页面出现 Invalid or unexpected token。
正确做法:插入页面最后一个 </body> 前。
idx = s.rfind('</body>')
s = s[:idx] + '<script src="/beian-footer.js"></script>\n' + s[idx:]
六、检查命令
cd /var/www/quiz ls -lh public/beian.png public/beian-footer.js file public/beian.png grep -n "beian-footer.js" public/login.html public/teacher.html public/student.html public/help.html public/admin-guide.html grep -n "闽ICP备2026023379号\|闽公网安备35012102550517号" public/beian-footer.js curl -I http://127.0.0.1:3000/beian.png curl -s http://127.0.0.1:3000/teacher.html?v=beian-check | tail -20 curl -s http://127.0.0.1:3000/student.html?id=66\&v=beian-check | tail -20
七、测试要求
- 教师端、学生端、登录页、操作说明、维护说明页面底部均显示备案信息。
- 公安备案图标显示在公安备案号前面。
- 点击 ICP 备案号跳转到
https://beian.miit.gov.cn/。 - 点击公安备案号跳转到公安备案查询页面。
- 教师端和学生端控制台不再出现
Invalid or unexpected token。