注册校验器问题
来源:5-9 LinValidator综合应用
风雨舟二郎
2019-06-01


如图所示,校验器在这里一直读取不到值,之后碰到需要读取http的请求体body的时候就直接抛出了异常,并且这个异常不是httpException.class。
其余代码与视频无异
问题已经解决了:【之前注册的body-parser没生效(因为注册晚了),现在调整了一下顺序,ok了。】
写回答
2回答
-
这里我调试不了。我觉得你首先应该更新下 git,然后把源码里的lin-validator v2 替换原来的lin-validator。如果还是有问题,那么就对比下源代码。
00 -
爱偷懒的小码农
2019-06-02
我也遇到这个问题,但是我换成lin-validator-v2里面的代码,会报
d:\nodejs\node.exe --inspect-brk=37927 app.js Debugger listening on ws://127.0.0.1:37927/efec334d-b320-4b25-8b84-e25ec1aecde0 For help, see: https://nodejs.org/en/docs/inspector Debugger attached. (node:20652) UnhandledPromiseRejectionWarning: Error at RegisterValidator.validate (c:\Users\11705\Desktop\个人项目\商业级项目nodejs开发微信小程序服务端\wzh-nodejs\core\lin-validator.js:81:19) warning.js:18 (node:20652) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) warning.js:18 (node:20652) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
122019-06-02
相似问题