Bläddra i källkod

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

CrazyIter_Bin 1 år sedan
förälder
incheckning
b77a726e6b
2 ändrade filer med 9 tillägg och 5 borttagningar
  1. 8 4
      TEAMModelOS/Controllers/Common/ActivityController.cs
  2. 1 1
      TEAMModelOS/Startup.cs

+ 8 - 4
TEAMModelOS/Controllers/Common/ActivityController.cs

@@ -3488,8 +3488,9 @@ namespace TEAMModelOS.Controllers
                                         double score = -1;
                                         int levelStatus = -1;
                                         string scoreLevel = string.Empty;
+                                        int showType = -1;
                                         List<dynamic> detailScore = new List<dynamic>();
-                                        if (contest.score!=null  && contest.score.scoreStatus==1  && now>contest.score?.stime  && now<contest.score.etime)
+                                        if (contest.score!=null  && contest.score.scoreStatus==1  && now>contest.score?.stime  && now<contest.score.etime  && enroll.upload!=null)
                                         {
                                             score=enroll.upload.score;
                                             if (enroll.upload.showScore==1) {
@@ -3508,6 +3509,7 @@ namespace TEAMModelOS.Controllers
                                             else {
                                                 levelStatus=0;
                                             }
+                                            showType=contest.score.showType;
                                             if (contest.score.showDetail==1) {
                                                 string sql = $"select value c from c join t in c.contestTasks where t.uploadId='{enroll.upload.uploadId}' and c.pk='ActivityExpertTask' ";
                                                 var result = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetList<ActivityExpertTask>(sql, $"ActivityExpertTask-{_activityId}");
@@ -3523,10 +3525,12 @@ namespace TEAMModelOS.Controllers
                                                 }
                                             }
                                         }
-                                        enroll.upload.score=-1;
-                                        enroll.upload.maskScore=-1;
+                                        if (enroll.upload!=null) {
+                                            enroll.upload.score=-1;
+                                            enroll.upload.maskScore=-1;
+                                        }
                                         
-                                        return Ok(new { code = 200, enroll,scoreData=new { levelStatus , score, scoreLevel, showType=contest.score.showType, detailScore } });
+                                        return Ok(new { code = 200, enroll,scoreData=new { levelStatus , score, scoreLevel, showType, detailScore } });
                                     }
                                     return Ok(new { code = 1, msg = "暂无报名数据!", });
 

+ 1 - 1
TEAMModelOS/Startup.cs

@@ -100,7 +100,7 @@ namespace TEAMModelOS
                     builder.WithOrigins("http://teammodelos-test.chinacloudsites.cn",
                                         "https://www.teammodel.cn", "https://localhost:5001",
                                         "http://localhost:5000", "http://localhost:64524",
-                                        "https://localhost:44341", "https://localhost:8888", "http://localhost:8888")
+                                        "https://localhost:44341", "https://localhost:8888", "http://localhost:8888", "https://localhost:8081", "http://localhost:8081")
                     .AllowAnyHeader()
                     .AllowAnyMethod();
                 });