From ce4e7cdc4438b37207387280ade3fcb9bdf85e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Sun, 6 Dec 2020 20:08:06 +0800 Subject: [PATCH] :bug: bug fix --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index b3f6b86..a0fbd1d 100644 --- a/server.js +++ b/server.js @@ -4,7 +4,6 @@ const XiaoAi = require('xiaoai-tts') // 输入小米账户名,密码 const user = process.env.MIUSER const pwd = process.env.MIPWD -const miClient = new XiaoAi(user, pwd) const app = express() @@ -12,6 +11,9 @@ app.get('/sms', (req, res) => { const params = req.query console.log("收到请求,参数:%s", params) let text = "收到" + params.title.replace(" 86", "") + ",短信内容:" + params.msg + // 登录小米账号 + const miClient = new XiaoAi(user, pwd) + // 让小爱同学说话 miClient.say(text) res.end('success'); })