Explorar o código

修改添加学生问题

zengyicheng %!s(int64=2) %!d(string=hai) anos
pai
achega
cd829408fb
Modificáronse 1 ficheiros con 12 adicións e 2 borrados
  1. 12 2
      pbl.js

+ 12 - 2
pbl.js

@@ -920,12 +920,14 @@ router.route('/batchRegistrationMore').post(function(req, res, next) {
 router.route('/batchRegistration').post(function(req, res, next) {
     var users = req.body[0];
     //循环注册
-    var _username = users.username;
+    var _username = users.alias;
+    var _mail = users.username;
     var _password = users.password || "123456";
     var _alias = users.alias;
     var _oid = users.oid;
     var _ph = users.ph;
     var _class = users.cid;
+    var _sId = users.sid;
     //加密密碼
     _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
     //生成激活碼
@@ -933,7 +935,7 @@ router.route('/batchRegistration').post(function(req, res, next) {
     let _digest = crypto.createHash('sha256').update(_hashstr, 'utf8').digest('hex');
     //用戶數據
     var _userdata = [
-        _username,
+        _mail,
         _password,
         _alias,
         "",
@@ -943,6 +945,14 @@ router.route('/batchRegistration').post(function(req, res, next) {
         generateAPIKey(_username),
         _digest,
         "",
+        _username,
+        _sId,
+        2,
+        _oid,
+        _ph,
+        _class,
+        '',
+        "0",
     ];
     //參數拼接,註冊
     _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");