Skip to content

Commit

Permalink
Merge branch 'main' of github.com:walinejs/waline
Browse files Browse the repository at this point in the history
  • Loading branch information
lizheming committed Sep 17, 2023
2 parents 593c1c0 + e1402e6 commit d74c765
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/src/en/guide/features/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ We use [Mr. Server](http://sc.ftqq.com/3.version) to wechat notification. You ne
We use [Mr. Qmsg](https://qmsg.zendee.cn) to send QQ notification. You need to set `QMSG_KEY` in env which applied in Mr. Qmsg.

- `QMSG_KEY`: KEY applied in Mr. Qmsg, It's required for this service.
- `QMSG_HOST`: HOST applied in Mr. QmsgPrivate, Optional. It's required for this host. Defalut is `https://qmsg.zendee.cn`
- `QQ_ID`: The QQ ID of the receiver(s), except for QQ group. If there are more than one QQ ID, use commas to separate multiple values, e.g. `1244453393,2952937634` (should all be included in your Mr. Qmsg's QQ ID list).
- `AUTHOR_EMAIL`: The blogger’s email is used to distinguish whether the posted comment is posted by the blogger himself. If it is posted by the blogger, there will be no reminder notification.
- `SITE_NAME`: Your site name, it will be displayed in notification message.
Expand Down
1 change: 1 addition & 0 deletions docs/src/guide/features/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ww479cadfqfe8c151f,MPKN9gX97w4e4b4h4u7u4i4i4i4iO6mN_dDedBFzqC5c,@all,1000002,2S8
QQ 通知使用了 [Qmsg 酱](https://qmsg.zendee.cn) 提供的服务,需要在环境变量中配置在 Qmsg 酱中申请的 `QMSG_KEY`

- `QMSG_KEY`: Qmsg 酱提供的 KEY,必填。
- `QMSG_Host`: Qmsg 酱提供的私有化 HOST,选填。默认为 `https://qmsg.zendee.cn`
- `QQ_ID`: 接收消息的 QQ 号 (不支持 QQ 群),可以添加多个,以半角逗号分割,如: `1244453393,2952937634` (必须均在您的 Qmsg 酱 QQ 号列表中)。
- `AUTHOR_EMAIL`: 博主邮箱,用来区分发布的评论是否是博主本身发布的。如果是博主发布的则不进行提醒通知。
- `SITE_NAME`: 网站名称,用于在消息中显示。
Expand Down
2 changes: 1 addition & 1 deletion packages/hexo-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"NexT",
"waline"
],
"homepage": "https://github.com/walinejs/waline/packages/hexo-next/#readme",
"homepage": "https://github.com/walinejs/waline/tree/main/packages/hexo-next#readme",
"bugs": {
"url": "https://github.com/walinejs/waline/issues"
},
Expand Down
6 changes: 4 additions & 2 deletions packages/server/src/service/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ module.exports = class extends think.Service {
}

async qq(self, parent) {
const { QMSG_KEY, QQ_ID, SITE_NAME, SITE_URL } = process.env;
const { QMSG_KEY, QQ_ID, SITE_NAME, SITE_URL, QMSG_HOST } = process.env;

if (!QMSG_KEY) {
return false;
Expand Down Expand Up @@ -219,7 +219,9 @@ module.exports = class extends think.Service {
form.append('msg', this.ctx.locale(contentQQ, data));
form.append('qq', QQ_ID);

return fetch(`https://qmsg.zendee.cn/send/${QMSG_KEY}`, {
const qmsgHost = QMSG_HOST ? QMSG_HOST.replace(/\/$/, '') : 'https://qmsg.zendee.cn';

return fetch(`${qmsgHost}/send/${QMSG_KEY}`, {
method: 'POST',
header: form.getHeaders(),
body: form,
Expand Down

0 comments on commit d74c765

Please sign in to comment.