zhangdocs 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zhangdocs",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Simple document generation tool. Dependence Node.js run.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,16 +1,35 @@
1
1
  <% include head.ejs %>
2
2
 
3
- <div class="container">
3
+ <div class="container" id="main-container" style="display: none;">
4
+
5
+ <div class="page-toc">
6
+ <%- toc_html %>
7
+ </div>
8
+
9
+ <div class="content markdown-body">
10
+ <%- markdown_html %>
11
+ <div class="copyright">Powered by <a href="https://github.com/jaywcjlove/zhangdocs"
12
+ target="_blank">zhangdocs</a>. Dependence <a href="https://nodejs.org">Node.js</a> run.</div>
13
+ </div>
4
14
 
5
- <div class="page-toc">
6
- <%- toc_html %>
7
- </div>
8
-
9
- <div class="content markdown-body">
10
- <%- markdown_html %>
11
- <div class="copyright">Powered by <a href="https://github.com/jaywcjlove/zhangdocs" target="_blank">zhangdocs</a>. Dependence <a href="https://nodejs.org">Node.js</a> run.</div>
12
15
  </div>
13
16
 
14
- </div>
17
+ <script>
18
+ document.addEventListener('DOMContentLoaded', function () {
19
+ // 检查localStorage中的token
20
+ const token = localStorage.getItem('token');
21
+ const expectedToken = 'A3F78D1E4C9B2A5F0E6D7C8B5A4F3E2D1C0B9A8F7E6D5C4B3A2F1E0D9C8B7A6F5E4';
22
+
23
+ const mainContainer = document.getElementById('main-container');
24
+
25
+ if (token === expectedToken) {
26
+ // 权限验证通过,显示内容
27
+ mainContainer.style.display = 'block';
28
+ } else {
29
+ // 权限验证失败,保持隐藏状态(显示空白)
30
+ mainContainer.style.display = 'none';
31
+ }
32
+ });
33
+ </script>
15
34
 
16
- <% include footer.ejs %>
35
+ <% include footer.ejs %>