-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
客户端发送消息的时候 服务器没有反应, #249
Comments
确认绑定对了吗 |
我也是这个问题, 服务器已配置成功... 代码如下: var express = require('express'); app.listen(80); |
问题解决了... 域名路径问题 微信服务器配置中不带 /wechat路径,代码修改为 |
app.js
` app.use(express.query());
app.use('/wechat', wechat(config, function (req, res, next) {
// 微信输入信息都在req.weixin上
var message = req.weixin;
if (message.FromUserName === '屌丝') {
// 回复屌丝(普通回复)
res.reply('hehe');
} else if (message.FromUserName === 'text') {
//你也可以这样回复text类型的信息
res.reply({
content: 'text object',
type: 'text'
});
} else if (message.FromUserName === '呵呵') {
// 回复一段音乐
res.reply({
type: "music",
content: {
title: "来段音乐吧",
description: "一无所有",
musicUrl: "http://mp3.com/xx.mp3",
hqMusicUrl: "http://mp3.com/xx.mp3",
thumbMediaId: "thisThumbMediaId"
}
});
} else {
// 回复高富帅(图文回复)
res.reply([
{
title: '你来我家接我吧',
description: '这是女神与高富帅之间的对话',
picurl: 'http://nodeapi.cloudfoundry.com/qrcode.jpg',
url: 'http://nodeapi.cloudfoundry.com/'
}
]);
}
}));
下面验证服务器 没问题 7500 和 80 端口绑定了 routes/index.js
router.get('/', function(req, res, next) {
console.log(req.url)
var query = req.query;
});
`
接口配置也成功了 http://xxxx:7500 没问题 但是发送消息没有反应
项目是用express-generate 生成的 求解。。。 谢主隆恩
The text was updated successfully, but these errors were encountered: