|
|
@@ -69,6 +69,8 @@ class UserController {
|
|
|
ctx.body = Response.failed('验证码错误');
|
|
|
}else if(!myReg.test(data.email)){
|
|
|
ctx.body = Response.failed('邮箱格式有误');
|
|
|
+ }else if(data.name.length<1 || data.name.length>10 || data.password.length<6 || data.password.length>20 || data.phone!==11){
|
|
|
+ ctx.body = Response.failed('参数非法');
|
|
|
}else{
|
|
|
const hashPassword = bcrypt.hashSync(data.password, 10);
|
|
|
const result = await userModel.create(data.name, hashPassword, data.phone, data.email);
|