CrazyIter_Bin před 3 měsíci
rodič
revize
718bc348dc

+ 4 - 3
TEAMModelOS.Extension/IES.Exam/IES.ExamServer/Controllers/StudentController.cs

@@ -60,6 +60,7 @@ namespace IES.ExamServer.Controllers
                 evaluationClient = _liteDBFactory.GetLiteDatabase().GetCollection<EvaluationClient>().FindOne(x => x.id == setting.evaluationId);
                 if (evaluationClient!=null) 
                 {
+                    //检查是否在作答时间内
                     (code, msg)=  CheckActivate(evaluationClient, setting);
                     if (code==200)
                     {
@@ -73,9 +74,9 @@ namespace IES.ExamServer.Controllers
                         }
                         string id = $"{studentId}";
                         string name = $"{studentName}";
-                        string  x_auth_token = JwtAuthExtension.CreateAuthToken("www.teammodel.cn", id, name, picture: string.Empty
-                            , ExamConstant.JwtSecretKey, ExamConstant.ScopeVisitor, 8, schoolID: school?.id, new string[] { "student" }, expire: 1);
-                        _liteDBFactory.GetLiteDatabase().GetCollection<Teacher>().Upsert(new Teacher { id = id, name = $"{name}",  picture = null, x_auth_token = x_auth_token, loginTime=time });
+
+                        string  x_auth_token = JwtAuthExtension.CreateAuthToken("www.teammodel.cn", id, name, picture: string.Empty , ExamConstant.JwtSecretKey, ExamConstant.ScopeVisitor, 8, schoolID: school?.id, new string[] { "student" }, expire: 1);
+                        //_liteDBFactory.GetLiteDatabase().GetCollection<Teacher>().Upsert(new Teacher { id = id, name = $"{name}",  picture = null, x_auth_token = x_auth_token, loginTime=time });
                         return Ok(new { code = 200, x_auth_token = x_auth_token });
                     }
                 }