diff --git a/controller/meetingController.js b/controller/meetingController.js index 59fe1fe..6a998fc 100644 --- a/controller/meetingController.js +++ b/controller/meetingController.js @@ -76,6 +76,7 @@ meetingController.prototype.createMeeting = async(ctx,next)=>{ } builder.options.rootName = 'param' + console.log(JSON.stringify(meeting)) var xml = builder.buildObject(meeting); console.log(xml) let info = await requestUtil.post('http://markettest.xuedianyun.com/3m/meeting/join_mtg.do',xml); @@ -94,7 +95,6 @@ meetingController.prototype.createMeeting = async(ctx,next)=>{ meetingController.prototype.getMeeting = async(ctx,next) =>{ try { let meetingbody = ctx.request.body; - console.log(meetingbody) if(!meetingbody.siteId){ return status.paramError('siteId'); } diff --git a/controller/userController.js b/controller/userController.js index 640b2d2..d7a5091 100644 --- a/controller/userController.js +++ b/controller/userController.js @@ -21,7 +21,7 @@ var userController =function (){ userController.prototype.addUser = async(ctx, next) =>{ try{ var params = ctx.request.body; - var pw = saitMd5.md5AddSalt(params.password) + var pw = saitMd5.md5(params.password) if(!params.loginName){ return status.paramError('loginName'); @@ -51,11 +51,9 @@ userController.prototype.addUser = async(ctx, next) =>{ var user = { id:id, loginName:params.loginName, - password:pw.md5Pass, + password:pw, companyName:params.companyName, userName:params.userName, - IDcard:params.IDcard, - salt:pw.salt, time:params.time, userType:params.userType, userRole:params.userRole, diff --git a/dump.rdb b/dump.rdb index 50c3f93..e881e28 100644 Binary files a/dump.rdb and b/dump.rdb differ diff --git a/services/meetingService.js b/services/meetingService.js index 83a2104..c51c700 100644 --- a/services/meetingService.js +++ b/services/meetingService.js @@ -19,8 +19,6 @@ meetingService.prototype.createMeeting = async(meetingInfo) =>{ } meetingService.prototype.getMeeting = async(queryData,page = 1,pageno =12) =>{ try { - console.log(queryData) - console.log(pageno,page,(page-1)*pageno) let backMeeting = await meetingModel.findAll({where:queryData,order:[['createTime', 'DESC']], offset: (page-1)*pageno, limit: pageno}); let count = await meetingModel.count({where:queryData}) return {meetingInfo:backMeeting,count:count,page:page,pageno:pageno}; diff --git a/services/userService.js b/services/userService.js index 7fc0a21..5866ce6 100644 --- a/services/userService.js +++ b/services/userService.js @@ -46,10 +46,10 @@ userService.prototype.login = async(loginName,pw,userEmail) => { ]; let User = await userModel.find({where:{$or:queryData}}) console.dir(User) - console.log(User.password, saitMd5.md5Salt(pw,User.salt)) + console.log(User.password, saitMd5.md5(pw,User.salt)) if(!User){ return {code:300,msg:'用户不存在'} - }else if(User.password != saitMd5.md5Salt(pw,User.salt)){ + }else if(User.password != saitMd5.md5(pw)){ return {code:300,msg:'密码不正确'} } let token = await tokenUtil.getSession(User); diff --git a/util/saltMD5.js b/util/saltMD5.js index c3a233b..01c1d85 100644 --- a/util/saltMD5.js +++ b/util/saltMD5.js @@ -4,7 +4,7 @@ module.exports={ md5AddSalt:function(password){ var salt=Math.floor(Math.random()*100); var decipher = crypto.createHash('md5',key); - var md5Pass=decipher.update(password+""+salt).digest("hex"); + var md5Pass=decipher.update(password).digest("hex"); return { salt:salt, md5Pass:md5Pass @@ -15,10 +15,7 @@ module.exports={ return md5Pass }, md5Salt:function(password,salt){ - if(salt == null){ - salt = ''; - } var decipher = crypto.createHash('md5',key); - return decipher.update(password+salt).digest("hex"); + return decipher.update(password).digest("hex"); } }; \ No newline at end of file