Browse Source

学生账号不能登陆问题

CrazyIter_Bin 4 years ago
parent
commit
973fe9541e
1 changed files with 12 additions and 10 deletions
  1. 12 10
      TEAMModelOS/Controllers/School/StudentController.cs

+ 12 - 10
TEAMModelOS/Controllers/School/StudentController.cs

@@ -1834,17 +1834,19 @@ namespace TEAMModelOS.Controllers
                                     {
                                         stulistId = listId.GetString();
                                     }
-                                    if (!stulistidsTea.ContainsKey(courseCode))
-                                    {
-                                        Dictionary<string, string> pCourseIdDic = new Dictionary<string, string>();
-                                        pCourseIdDic.Add(courseId, stulistId);
-                                        stulistidsTea.Add(courseCode, pCourseIdDic);
-                                    }
-                                    else
-                                    {
-                                        if(!stulistidsTea[courseCode].ContainsKey(courseId))
+                                    if (!string.IsNullOrEmpty(courseCode)) {
+                                        if (!stulistidsTea.ContainsKey(courseCode))
                                         {
-                                            stulistidsTea[courseCode].Add(courseId, stulistId);
+                                            Dictionary<string, string> pCourseIdDic = new Dictionary<string, string>();
+                                            pCourseIdDic.Add(courseId, stulistId);
+                                            stulistidsTea.Add(courseCode, pCourseIdDic);
+                                        }
+                                        else
+                                        {
+                                            if (!stulistidsTea[courseCode].ContainsKey(courseId))
+                                            {
+                                                stulistidsTea[courseCode].Add(courseId, stulistId);
+                                            }
                                         }
                                     }
                                 }