feat(admin): 添加管理员密钥验证功能
- 新增管理员密钥设置及验证流程 - 实现前端验证弹窗及本地存储加密 - 修改评论提交接口支持管理员验证 - 添加相关样式和文档说明
This commit is contained in:
@@ -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>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user