var wechat = new Wechat(opts);
//console.log('---------wechat.reply-------');
//console.log( wechat.reply);
wechat.reply.call(this);
Wechat.prototype.reply = function () {
var content = this.body;
var message = this.weixin;
var xml = util.tpl(content,message);
this.status = 200;
this.type = 'application/xml';
this.body = xml;
console.log('reply');
};
出现这样的错误
TypeError: Cannot read property 'call' of undefined
实例方法也有,为什么会出现这样的错误呀
调用函数的代码,写在定义的后面,也就是说下面的两行代码放到最后
再写清楚点吧: