## egg-joi 验证插件 ### npm 参考地址:https://www.npmjs.com/package/egg-joi ### 根据npm上的配置说明 **这样配没有触发[未知问题]** ![](https://img.kancloud.cn/68/c2/68c209eafa4c5608388c4a55dc5bfb4d_852x404.png) **改为这样配置才会触发** ![](https://img.kancloud.cn/72/55/725572bdd1765b63469a62440e1e5498_715x488.png) ## 扩展extend/context.js ![](https://img.kancloud.cn/3a/e8/3ae82a854935273e8c1fbfe07a5ce422_951x499.png) ## Controller中调用,为了区分throw的状态码 ![](https://img.kancloud.cn/da/32/da32ccfa719be6dcdd702d8d55d85c30_791x309.png) ### GetUserIdentity ![](https://img.kancloud.cn/f6/48/f648f5f2bbe87e068b0039bad073c097_806x327.png) ## 扩展 * https://www.cnblogs.com/zzbo/p/5906101.html * joi是hapijs自带的数据检测模块