Bläddra i källkod

打开拦截信息

zhouj1203@hotmail.com 3 år sedan
förälder
incheckning
71772d928c

+ 4 - 4
TEAMModelOS.SDK/Models/Service/LessonService.cs

@@ -163,7 +163,7 @@ namespace TEAMModelOS.SDK.Models.Service
                 //int years = DateTimeOffset.UtcNow.DayOfYear;
                 string tbname = string.Empty;
                 string code = string.Empty;
-                if (data.scope.Equals("school"))
+                if (data.scope != null && data.scope.Equals("school"))
                 {
                     code = $"LessonCount-{data.school}-{year}-{data.periodId}";
                     tbname = "School";
@@ -176,13 +176,13 @@ namespace TEAMModelOS.SDK.Models.Service
                 var response = await client.GetContainer(Constant.TEAMModelOS, tbname).ReadItemStreamAsync(data.tmdid.ToString(), new PartitionKey(code));
                 if (response.Status == 200)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                   /* using var json = await JsonDocument.ParseAsync(response.ContentStream);
                     LessonCount count = json.ToObject<LessonCount>();
 
                     count.tCount[day - 1] += lessonDis.disTCount;
                     count.pCount[day - 1] += lessonDis.disPCount;
                     count.ptCount[day - 1] += lessonDis.disDCount;
-                    count.beginCount[day - 1] += lessonDis.record;
+                    count.beginCount[day - 1] += lessonDis.record;*/
                     /*if (!count.courseIds.Contains(data.courseId))
                     {
                         count.courseIds.Add(data.courseId);
@@ -190,7 +190,7 @@ namespace TEAMModelOS.SDK.Models.Service
                     }*/
 
 
-                    await client.GetContainer("TEAMModelOS", tbname).ReplaceItemAsync(count, count.id, new PartitionKey(code));
+                    //await client.GetContainer("TEAMModelOS", tbname).ReplaceItemAsync(count, count.id, new PartitionKey(code));
                 }
                 else
                 {

+ 2 - 2
TEAMModelOS/Controllers/Analysis/ClassAnalysisController.cs

@@ -741,8 +741,8 @@ namespace TEAMModelOS.Controllers.Analysis
             }
         }
         [ProducesDefaultResponseType]
-       /* [Authorize(Roles = "IES")]
-        [AuthToken(Roles = "teacher,admin")]*/
+        [Authorize(Roles = "IES")]
+        [AuthToken(Roles = "teacher,admin")]
         [HttpPost("settle-recod")]
         public async Task<IActionResult> settleRecod(JsonElement request)
         {