akira-cn / think-wechat Goto Github PK
View Code? Open in Web Editor NEW微信中间件,同时支持 thinkJS 3.0
License: MIT License
微信中间件,同时支持 thinkJS 3.0
License: MIT License
编辑 config/hook.js 增加一个 hook
这里的路径是不是应该修正为
按照官网的例子,控制台一直输出以下信息:
/wechat<>weixin/wechat
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
Error: PREVENT_NEXT_PROCESS
nodejs : 7.4
thinkjs : 2.2.16
按照Readme中的说明,中间件配置成功,运行时报错 环境:think.js 2.x
Thinkjs 3.0 使用过程中,
async eventAction(){ const message = this.post(); think.logger.info('eventAction:'); think.logger.info(message); return this.success(123); }
在公众号点击菜单事件,文本直接立刻返回123,但是公众号仍会显示“获取中...”数秒才消失,请问如何优化
通过微信给服务端发送消息后,服务端报错
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×tamp=1456901036&nonce=1532463979 200 13ms
感觉这个中间件没起作用,没有进入处理文字消息的action
textAction(){
var message = this.post();
console.log(message);
var msg = message.Content.trim();
this.reply('测试成功:'+msg);
}
如题.
搞不懂配置哪个module,哪个controller,懵逼了。。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.