付智勇

no message

... ... @@ -47,12 +47,13 @@ userService.prototype.login = async(loginName,pw,userEmail) => {
{loginName:loginName}
];
let User = await userModel.find({where:{$or:queryData}})
let attachment = await attachmentModel.findOne({where:{businessId:User.id}})
if(!User){
return {code:300,msg:'用户不存在'}
}else if(User.password != saitMd5.md5(pw)){
return {code:300,msg:'密码不正确'}
}
let attachment = await attachmentModel.findOne({where:{businessId:User.id}})
let token = await tokenUtil.getSession(User);
if(attachment){
token.userPhoto = attachment.path
... ... @@ -173,7 +174,7 @@ userService.prototype.updatePwByTelphone = async(tel,pw) => {
var t = await sequelize.transaction({ autocommit: true })
let User = await userModel.findOne({where:{userMobile:tel}})
if(!User){
t.rollback
t.rollback()
return {code:0,msg:'用户不存在'}
}
let updateUser = await userModel.update({password:pw.md5Pass,salt:pw.salt},{where:{userMobile:tel}});
... ...