Skip to content

Commit

Permalink
feat: update docs (#204)
Browse files Browse the repository at this point in the history
* feat: update docs

* feat: update docs
  • Loading branch information
dreamhunter2333 authored May 5, 2024
1 parent 66a6d40 commit 9d84eb0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions vitepress-docs/docs/.vitepress/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
items: [
{ text: '配置 SMTP 代理服务', link: 'feature/config-smtp-proxy' },
{ text: '发送邮件 API', link: 'feature/send-mail-api' },
{ text: '查看邮件 API', link: 'feature/mail-api' },
{ text: '配置子域名邮箱', link: 'feature/subdomain' },
]
},
Expand Down
18 changes: 18 additions & 0 deletions vitepress-docs/docs/zh/guide/feature/mail-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 查看邮件 API

## 通过 HTTP API 查看邮件

这是一个 `python` 的例子,使用 `requests` 库查看邮件。

```python
limit = 10
offset = 0
res = requests.post(
f"http://localhost:8787/api/mails?limit={limit}&offset={offset}`;",
json=send_body, headers={
"Authorization": f"Bearer {你的JWT密码}",
# "x-custom-auth": "<你的网站密码>", # 如果启用了自定义密码
"Content-Type": "application/json"
}
)
```
4 changes: 2 additions & 2 deletions vitepress-docs/docs/zh/guide/feature/send-mail-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ res = requests.post(
"http://localhost:8787/api/send_mail",
json=send_body, headers={
"Authorization": f"Bearer {你的JWT密码}",
"x-custom-auth": "<你的网站密码>",
# "x-custom-auth": "<你的网站密码>", # 如果启用了自定义密码
"Content-Type": "application/json"
}
)

# 使用 body 验证
send_body = {
"token": "<你的JWT密码>
"token": "<你的JWT密码>",
"from_name": "发件人名字",
"to_name": "收件人名字",
"to_mail": "收件人地址",
Expand Down

0 comments on commit 9d84eb0

Please sign in to comment.