
NodeJS
Dobility
这个作者很懒,什么都没留下…
展开
-
微信小程序 msg_sec_check 正确调用方式
在服务端使用微信小程序的内容安全检查等接口时,尽管按文档 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/sec-check/security.msgSecCheck.html 的要求传了参数,但是还是会出错,而用 postman 等工具却正常,以下分享调试经验。1. 正确调用方式在服务端发起调用时,网...原创 2020-01-07 17:27:19 · 8645 阅读 · 0 评论 -
Warning: no saslprep library specified. Passwords will not be sanitized
在 nodejs 中使用密码连接 mongodb 时,会报 warning:Warning: no saslprep library specified. Passwords will not be sanitized在 mongodb 的依赖里 node_modules/mongodb/lib/core/auth/scram.js 发现有以下代码:12: let saslprep;13...原创 2020-01-02 10:43:40 · 1888 阅读 · 0 评论 -
egg-shell-decorators结合egg-jwt实现token验证
在 egg.js 搭建服务端框架过程中,我使用了装饰器 egg-shell-decorators,配置和使用可以直接参考 https://super2god.github.io/egg-shell-decorators/#/ 来简化我的 controller 配置 router,同时用了 egg-jwt 来进行身份验证,按照其文档的配置过程之后,我还是遇到了坑。如果你使用了 egg-jwt,那...原创 2019-10-17 22:01:01 · 1349 阅读 · 0 评论 -
Knex对bit类型进行取值方式
最近建表的时候,is_promotion字段打算用来放 true|false|NULL 的布尔变量,于是设置了 bit 类型。在node端使用knex查询的时候,在对 is_promotion 取值的时候展示了一个类似普通对象的假象:通过 is_promotion.data[0]取值将会报错或者无效。事实上它返回的不是 true | false | null 或者 0 | 1 | null,也...原创 2019-07-23 15:18:20 · 383 阅读 · 0 评论