zengyicheng 1 год назад
Родитель
Сommit
3eb4d1f3e9
1 измененных файлов с 42 добавлено и 42 удалено
  1. 42 42
      ssti.js

+ 42 - 42
ssti.js

@@ -739,48 +739,48 @@ router.post('/userLogin', (req, res) => {
     const getUserid = getUid(str);
 
     res.end(getUserid)
-    if (md5(data['id']) == getUserid) {
-        //查询用户的数据
-        mysql.usselect([_mysqlLabor[0], _mysqlLabor[1], 'select_UserByUserId', data['id']], function(ret) {
-            if (ret[0].length == 0) { //数据库没有这个人的数据,查询学生表或者老师表获取数据
-                mysql.usselect([_mysqlLabor[0], _mysqlLabor[1], 'select_UserMessageById', data['id']], (ret2) => {
-                    let userData = {};
-                    // console.log(ret2);
-                    if (ret2[0].length) {
-                        userData = ret2[0][0];
-                        userData['type'] = 2
-                    } //学生数据
-                    else if (ret2[1].length) {
-                        userData = ret2[1][0]
-                        userData['zymc'] = '';
-                        userData['type'] = 1; //老师数据
-                    };
-                    // console.log(userData);
-                    // console.log();
-                    let bm = '';
-                    if (userData['type'] == 1) bm = userData['bm'] //因为老师部门和学生专业不一样,所以要判断用户类型进行填充user中的bm
-                    if (userData['type'] == 2) bm = userData['xy']
-
-                    //数据库用户表添加用户
-                    mysql.usselect([_mysqlLabor[0], _mysqlLabor[1], 'insert_User', userData['id'], userData['xm'], userData['type'], bm, userData['zymc']], (ret3) => {
-                        console.log(ret3);
-                        if (ret3 == 1) {
-                            res.end(JSON.stringify({ userid: userData['id'] }))
-                        } else {
-                            res.end('ERROR')
-                        }
-
-                    })
-                })
-            } else {
-                //数据库有数据
-                res.end(JSON.stringify({...ret[0][0] }));
-            }
-
-        });
-    } else {
-        res.end(JSON.stringify({ a: "身份认证失败!" }));
-    }
+        // if (md5(data['id']) == getUserid) {
+        //     //查询用户的数据
+        //     mysql.usselect([_mysqlLabor[0], _mysqlLabor[1], 'select_UserByUserId', data['id']], function(ret) {
+        //         if (ret[0].length == 0) { //数据库没有这个人的数据,查询学生表或者老师表获取数据
+        //             mysql.usselect([_mysqlLabor[0], _mysqlLabor[1], 'select_UserMessageById', data['id']], (ret2) => {
+        //                 let userData = {};
+        //                 // console.log(ret2);
+        //                 if (ret2[0].length) {
+        //                     userData = ret2[0][0];
+        //                     userData['type'] = 2
+        //                 } //学生数据
+        //                 else if (ret2[1].length) {
+        //                     userData = ret2[1][0]
+        //                     userData['zymc'] = '';
+        //                     userData['type'] = 1; //老师数据
+        //                 };
+        //                 // console.log(userData);
+        //                 // console.log();
+        //                 let bm = '';
+        //                 if (userData['type'] == 1) bm = userData['bm'] //因为老师部门和学生专业不一样,所以要判断用户类型进行填充user中的bm
+        //                 if (userData['type'] == 2) bm = userData['xy']
+
+    //                 //数据库用户表添加用户
+    //                 mysql.usselect([_mysqlLabor[0], _mysqlLabor[1], 'insert_User', userData['id'], userData['xm'], userData['type'], bm, userData['zymc']], (ret3) => {
+    //                     console.log(ret3);
+    //                     if (ret3 == 1) {
+    //                         res.end(JSON.stringify({ userid: userData['id'] }))
+    //                     } else {
+    //                         res.end('ERROR')
+    //                     }
+
+    //                 })
+    //             })
+    //         } else {
+    //             //数据库有数据
+    //             res.end(JSON.stringify({...ret[0][0] }));
+    //         }
+
+    //     });
+    // } else {
+    //     res.end(JSON.stringify({ a: "身份认证失败!" }));
+    // }
 
 })