学习joi的过程中在导出e.message过程中发现了如下错误
Joi.validate%20is%20not%20a%20function
通过查找发现是新版本joi的语法问题
原代码
//引入joi模块
const Joi=require('joi')
module.exports=async(req,res)=>{
//定义对象的验证规则
const schema={
username:Joi.string().min(2).max(12).required().error(new Error('用户名不符合验证规则')),
email:Joi.string().email().required().error(new Error('邮箱格式不符合要求'))