diff --git a/README.md b/README.md index 67068f7..317f02a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 消息推送服务 ## 描述 -1. 利用微信公众号测试号来给自己的微信推送消息。 +1. 利用微信公众号测试号或者微信企业号来给自己的微信推送消息。 2. 也可推送邮件消息,在微信中开启 QQ 邮件提醒后,也可以达到同样效果。 3. 支持 Markdown。 4. 可以使用 Heroku 的免费服务器,[详见此处](#在-Heroku-上的搭建步骤)。 @@ -40,6 +40,8 @@ ### 验证是否配置成功 访问 `https://你的域名/前缀/Hi`,如果你的微信能够收到一条内容为 Hi 的模板消息,则配置成功。 +如果出现问题,请务必仔细检查所填信息是否正确。 + ## 在 Heroku 上的搭建步骤 在此之前,请先读一下“在自己的服务器上的部署步骤”这一节。 由于 Heroku 的限制,当 30 分钟内没有请求的话就会被冻结,之后再次启动时数据就丢了,因此这里我们采用配置环境变量的方式进行配置。 diff --git a/app.json b/app.json index 49abd04..7955c94 100644 --- a/app.json +++ b/app.json @@ -37,7 +37,7 @@ }, "SMTP_SERVER": { "description": "smtp 服务器地址,如 smtp.qq.com", - "value": "", + "value": "smtp.qq.com", "required" : false }, "SMTP_USER": { @@ -46,7 +46,7 @@ "required" : false }, "SMTP_PASS": { - "description": "你自己设置的验证 token", + "description": "smtp 服务器用户凭据", "value": "", "required" : false }, diff --git a/routers/index.js b/routers/index.js index ef339da..6cd3930 100644 --- a/routers/index.js +++ b/routers/index.js @@ -33,6 +33,12 @@ router.get('/login', (req, res, next) => { }); router.post('/login', async (req, res, next) => { + if (process.env.MODE === '1') { + return res.render('register', { + message: '当前运行模式为 Heroku 模式,该模式下禁止用户登录', + isErrorMessage: true, + }); + } let user = { username: req.body.username, password: req.body.password,