akira-cn / think-wechat

微信中间件,同时支持 thinkJS 3.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unhandled rejection Error: PREVENT_NEXT_PROCESS

xueyuchen opened this issue · comments

通过微信给服务端发送消息后,服务端报错

Unhandled rejection Error: PREVENT_NEXT_PROCESS
    at Object.think.prevent (/home/project/weixin-demo/node_modules/thinkjs/lib/core/think.js:511:13)
    at _class.end (/home/project/weixin-demo/node_modules/thinkjs/lib/controller/base.js:426:18)
    at _class.indexAction (/home/project/weixin-demo/app/wechat/controller/index.js:21:14)
    at _class._callee$ (/home/project/weixin-demo/node_modules/thinkjs/lib/core/base.js:78:44)
    at tryCatch (/home/project/weixin-demo/node_modules/thinkjs/node_modules/babel-runtime/regenerator/runtime.js:88:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/home/project/weixin-demo/node_modules/thinkjs/node_modules/babel-runtime/regenerator/runtime.js:341:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/home/project/weixin-demo/node_modules/thinkjs/node_modules/babel-runtime/regenerator/runtime.js:121:21)
    at step (/home/project/weixin-demo/node_modules/thinkjs/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/project/weixin-demo/node_modules/thinkjs/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:7
    at Promise._execute (/home/project/weixin-demo/node_modules/thinkjs/node_modules/bluebird/js/release/debuggability.js:180:9)
    at Promise._resolveFromExecutor (/home/project/weixin-demo/node_modules/thinkjs/node_modules/bluebird/js/release/promise.js:460:18)
    at new Promise (/home/project/weixin-demo/node_modules/thinkjs/node_modules/bluebird/js/release/promise.js:76:14)
    at _class.<anonymous> (/home/project/weixin-demo/node_modules/thinkjs/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)
    at _class.invoke (/home/project/weixin-demo/node_modules/thinkjs/lib/core/base.js:102:18)
    at _class.action (/home/project/weixin-demo/node_modules/thinkjs/lib/core/http_base.js:152:25)
    at _class.execAction (/home/project/weixin-demo/node_modules/thinkjs/lib/core/app.js:188:19)

[2016-03-02 14:43:57] [HTTP] POST /wechat/?signature=bd70de24ea2404e87a45883a4c405e334a0d42e6&timestamp=1456901036&nonce=1532463979 200 13ms

感觉这个中间件没起作用,没有进入处理文字消息的action

textAction(){
        var message = this.post();
        console.log(message);
        var msg = message.Content.trim();
        this.reply('测试成功:'+msg);
    }

作者?

commented

中间件正确加载了吗?可以的话发配置文件上来,不然没法判断那一步出了问题

commented

我大概知道了,wechat 必须要是 controller,目前支持的是 controller,不是 module,你的是进到 app/wechat/controller/index.js 了