|
@@ -222,6 +222,32 @@ router.route('/updatePassword').post(function(req, res, next) {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+/* 赛事修改密码 */
|
|
|
+router.route('/updatePassword1').post(function(req, res, next) {
|
|
|
+ //mode的处理
|
|
|
+ if (req.body[0]) {
|
|
|
+ let p = [req.body[0].userid];
|
|
|
+ p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword"); //執行存儲過程
|
|
|
+ mysql.usselect(p, function(ret) {
|
|
|
+ var paJ = ret[0][0].password
|
|
|
+ var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
|
|
|
+ bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
|
|
|
+ // console.log(result)
|
|
|
+ if (result) {
|
|
|
+ let p2 = [req.body[0].userid, bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10))];
|
|
|
+ p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword1"); //執行存儲過程
|
|
|
+ mysql.usselect(p2, function(ret) {
|
|
|
+ res.end(JSON.stringify([{ success: 1 }]));
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ res.end(JSON.stringify([{ success: 0 }]));
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+});
|
|
|
/* 找寻重复手机号 */
|
|
|
router.route('/findPhone').all((req, res, next) => {
|
|
|
var json = queryString(req.url);
|