feat(admin): 添加管理员密钥验证功能

- 新增管理员密钥设置及验证流程
- 实现前端验证弹窗及本地存储加密
- 修改评论提交接口支持管理员验证
- 添加相关样式和文档说明
This commit is contained in:
anghunk
2026-01-20 16:46:42 +08:00
parent a41d783326
commit ab67bfb40e
14 changed files with 554 additions and 12 deletions

View File

@@ -44,3 +44,35 @@
// 动态切换主题
comments.updateConfig({ theme: 'dark' });
```
### 博客程序使用示例
### HTML
```html
<div id="comments"></div>
<script src="https://cwd-comments.zishu.me/cwd-comments.js"></script>
<script>
const comments = new CWDComments({
el: '#comments',
apiBaseUrl: 'https://your-api.example.com', // 你部署的后端接口地址
});
comments.mount();
</script>
```
### Astro
```astro
<div id="comments"></div>
<script src="https://cwd-comments.zishu.me/cwd-comments.js" is:inline></script>
<script is:inline>
document.addEventListener('DOMContentLoaded', () => {
const comments = new window.CWDComments({
el: '#comments',
apiBaseUrl: 'https://your-api.example.com',
});
comments.mount();
});
</script>
```