zengyicheng 2 年之前
父節點
當前提交
9aa51c5581
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      pbl.js

+ 16 - 0
pbl.js

@@ -2509,6 +2509,22 @@ router.route('/batchRegistrationMore').post(function(req, res, next) {
         });
     }
 });
+//初始化密码
+router.route('/iniPassword').post(function(req, res, next) {
+    let users = req.body[0];
+    _password = users.pa;
+    //加密密碼
+    _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
+    //用戶數據
+    let _userList = [
+        users.uid,
+        _password,
+    ];
+    _userList.unshift(_mysqluser[0], _mysqluser[1], "iniPassword");
+    mysql.usselect(_userList, function(ret) {
+        res.end(JSON.stringify({ success: 1 }));
+    });
+});
 //批量添加教师
 router.route('/batchRegistrationMore1').post(function(req, res, next) {
     let users = req.body[0];