- SecurityHeaders 中间件生成随机 nonce,注入 context - BuildPageData/BuildAdminPageData 将 CSPNonce 传递给模板 - 所有 19 个模板文件 <script> 标签添加 nonce 属性 - 移除所有内联事件处理(onclick/onerror),改用事件监听 - 移除所有 javascript:void(0) 链接,改用 # 号 + preventDefault - utils.js 添加全局 avatar 图片加载失败回退处理 - common.js 登出按钮添加 preventDefault - audit.js 关闭弹窗按钮改用事件监听
23 lines
952 B
HTML
23 lines
952 B
HTML
{{template "layout/header.html" .}}
|
|
<body>
|
|
{{template "layout/nav.html" .}}
|
|
<div class="container">
|
|
<div class="error-404">
|
|
<div class="error-404-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/>
|
|
</svg>
|
|
</div>
|
|
<h1>页面未找到</h1>
|
|
<p>该帖子可能已被删除、尚未发布,或您输入的地址有误</p>
|
|
<div class="error-404-actions">
|
|
<a href="/" class="btn btn-secondary">返回首页</a>
|
|
<a href="/posts" class="btn btn-primary">浏览帖子</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{template "layout/footer.html" .}}
|
|
<script src="/static/js/common.js?v={{assetV "/static/js/common.js"}}" nonce="{{.CSPNonce}}"></script>
|
|
</body>
|
|
</html>
|