Ver código fonte

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

OnePsycho 2 anos atrás
pai
commit
aa253c33ba

+ 17 - 8
TEAMModelBI/Controllers/BISchool/SchoolController.cs

@@ -788,6 +788,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         schoolTeacher = json.ToObject<SchoolTeacher>();
                         schoolTeacher = json.ToObject<SchoolTeacher>();
                         if (!schoolTeacher.roles.Contains("admin"))
                         if (!schoolTeacher.roles.Contains("admin"))
                         {
                         {
+                            if(!schoolTeacher.roles.Contains("teacher")) schoolTeacher.roles.Add("teacher");
                             schoolTeacher.roles.Add("admin");
                             schoolTeacher.roles.Add("admin");
                             schoolTeacher.status = "join";
                             schoolTeacher.status = "join";
                             schoolTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<SchoolTeacher>(schoolTeacher, schoolTeacher.id, new PartitionKey($"Teacher-{schoolId}"));
                             schoolTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<SchoolTeacher>(schoolTeacher, schoolTeacher.id, new PartitionKey($"Teacher-{schoolId}"));
@@ -802,7 +803,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         {
                         {
                             id = $"{tmdId}",
                             id = $"{tmdId}",
                             code = $"Teacher-{schoolId}",
                             code = $"Teacher-{schoolId}",
-                            roles = new List<string> { "admin" },
+                            roles = new List<string> { "admin", "teacher" },
                             job = "管理员",
                             job = "管理员",
                             name = $"{tmdName}",
                             name = $"{tmdName}",
                             picture = string.IsNullOrEmpty($"{picture}") ? "" : $"{picture}",
                             picture = string.IsNullOrEmpty($"{picture}") ? "" : $"{picture}",
@@ -841,6 +842,7 @@ namespace TEAMModelBI.Controllers.BISchool
             var (_tmdId, _tmdName, _, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var (_tmdId, _tmdName, _, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("scIds", out JsonElement _scIds)) return BadRequest();
             if (!jsonElement.TryGetProperty("scIds", out JsonElement _scIds)) return BadRequest();
+            bool rmvFromSc = (jsonElement.TryGetProperty("rmvFromSc", out JsonElement rmvFromScJobj)) ? rmvFromScJobj.GetBoolean() : false; //rmvFromSc Bool true:移除SchoolTeacher document false:只移除roles中"admin"身分
             //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
 
             List<string> scIds = _scIds.ToObject<List<string>>();
             List<string> scIds = _scIds.ToObject<List<string>>();
@@ -858,16 +860,23 @@ namespace TEAMModelBI.Controllers.BISchool
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
                 if (response.Status == 200)
                 if (response.Status == 200)
                 {
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
-                    scTeacher = json.ToObject<SchoolTeacher>();
-                    if (scTeacher.roles.Contains("admin"))
+                    if (rmvFromSc)
                     {
                     {
-                        scTeacher.roles.Remove("admin");
-                        strMsg.Append($"{scId},");
-                        scTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<SchoolTeacher>(scTeacher, scTeacher.id, new PartitionKey($"Teacher-{scId}"));
+                        await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemAsync<SchoolTeacher>($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
                     }
                     }
                     else
                     else
-                        existScId.Add(scId);
+                    {
+                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        scTeacher = json.ToObject<SchoolTeacher>();
+                        if (scTeacher.roles.Contains("admin"))
+                        {
+                            scTeacher.roles.Remove("admin");
+                            strMsg.Append($"{scId},");
+                            scTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<SchoolTeacher>(scTeacher, scTeacher.id, new PartitionKey($"Teacher-{scId}"));
+                        }
+                        else
+                            existScId.Add(scId);
+                    }
                 }
                 }
                 else
                 else
                     existScId.Add(scId);
                     existScId.Add(scId);

+ 9 - 9
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -858,7 +858,7 @@ const LANG_EN_US = {
     },
     },
     // 课程管理
     // 课程管理
     cusMgt: {
     cusMgt: {
-        isLeaveSch: '(Checked Out)',
+        isLeaveSch: ' (Left School)',
         schoolClass: 'Copy school class',
         schoolClass: 'Copy school class',
         searchHolder: 'Search',
         searchHolder: 'Search',
         delBatch: 'Batch delete',
         delBatch: 'Batch delete',
@@ -3983,9 +3983,9 @@ const LANG_EN_US = {
     },
     },
     // 设置中心
     // 设置中心
     settings: {
     settings: {
-        initTitle: 'Initialization Note',
+        initTitle: 'Initialization Prompt',
         knowTip: 'Understand, no need to remind me in the future',
         knowTip: 'Understand, no need to remind me in the future',
-        initTip: 'Notice! When managing a new school for the first time, please complete the settings of the college (elementary, middle school, etc.), semester (first, second semester, etc.), grade (first, second, third grade, etc.) and subject (English, Math, Science, etc.) For higher education schools, please go to the general settings to modify it first.',
+        initTip: 'Note! When managing a new school for the first time, please complete the settings for school system (elementary, high school, etc.), semester (1st, 2nd semester, etc.), grade level (7th, 8th grade, etc.), and subject (history, math, etc.) before starting. If you are a higher education institution, please go to the Basic Settings to modify first.',
         setting_title1: 'School Management',
         setting_title1: 'School Management',
         setting_title2: 'General Settings',
         setting_title2: 'General Settings',
         setting_title3: 'Open Platform',
         setting_title3: 'Open Platform',
@@ -4086,7 +4086,7 @@ const LANG_EN_US = {
         openModal1: 'Failed to get the application list',
         openModal1: 'Failed to get the application list',
         openModal2: 'Failed to get the API list',
         openModal2: 'Failed to get the API list',
         applyForm: {
         applyForm: {
-            tip: 'School Management Services provides school-level application management. For example, set the semester period, subjects, and grades; systematically build class and student name lists, question banks, and resources; initiate cross-class exams, questionnaires, and voting activities. Welcome to apply for a trial experience.',
+            tip: 'School Management Services provides school-level application management. For example, set the semester period, subjects, and grades; systematically create class and student lists, question banks, and resources; initiate cross-class exams, surveys, and voting activities. We welcome you to apply for a trial experience.',
             title: 'Apply to create an AI Smarter School',
             title: 'Apply to create an AI Smarter School',
             name: 'Full Name of School/Institution',
             name: 'Full Name of School/Institution',
             id: 'School/Institution Short Code',
             id: 'School/Institution Short Code',
@@ -4096,7 +4096,7 @@ const LANG_EN_US = {
             address: 'School/Institution Address',
             address: 'School/Institution Address',
             manager: 'Person in charge of School/Institution',
             manager: 'Person in charge of School/Institution',
             cellphone: 'School/Institution Contact Phone Number',
             cellphone: 'School/Institution Contact Phone Number',
-            email: 'School/Institution Contact Email Address',
+            email: 'School/Institution Contact Email',
             noContactTip: 'At least one of the phone number or email is required',
             noContactTip: 'At least one of the phone number or email is required',
             content: 'Remark Information',
             content: 'Remark Information',
             place0: 'Please enter the full name (not the abbreviation)',
             place0: 'Please enter the full name (not the abbreviation)',
@@ -5408,12 +5408,12 @@ const LANG_EN_US = {
     // 课纲管理
     // 课纲管理
     syllabus: {
     syllabus: {
         importTip1: 'Note:',
         importTip1: 'Note:',
-        importTip2: '1. Currently, only table file in xls and xlsx formats are supported for batch creation.',
-        importTip3: '2. The size of the imported file cannot exceed 10M.',
-        importTip4: '3. Please strictly follow the import template format for editing.',
+        importTip2: '1. Currently, only xls and xlsx file formats are supported for batch import.',
+        importTip3: '2. The imported file size cannot exceed 10M.',
+        importTip4: '3. Please follow the import template format strictly when editing.',
         importTip5: 'Parsing template...',
         importTip5: 'Parsing template...',
         importTip6: 'Select the Excel file to import',
         importTip6: 'Select the Excel file to import',
-        importTip7: 'Batch import questions',
+        importTip7: 'Batch Import Questions',
         shareContentText1: 'Syllabus Sharing',
         shareContentText1: 'Syllabus Sharing',
         shareContentText2: 'Sharer',
         shareContentText2: 'Sharer',
         shareContentText3: 'Syllabus Name',
         shareContentText3: 'Syllabus Name',

+ 2 - 2
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -1159,7 +1159,7 @@ const LANG_ZH_TW = {
         confirmAdd: '確認新增',
         confirmAdd: '確認新增',
         cancelAdd: '取消新增',
         cancelAdd: '取消新增',
         createList: '新增選課班',
         createList: '新增選課班',
-        name: '名稱',
+        name: '名稱',
         nameHolder: '請輸入名單名稱…',
         nameHolder: '請輸入名單名稱…',
         nameRepeat: '選課班名稱重複',
         nameRepeat: '選課班名稱重複',
         pdHolder: '請設定學段',
         pdHolder: '請設定學段',
@@ -4111,7 +4111,7 @@ const LANG_ZH_TW = {
             place5: '請輸入負責人姓名',
             place5: '請輸入負責人姓名',
             place6: '請選擇所在地區',
             place6: '請選擇所在地區',
             place7: '請輸入統編或其他政府核發的機構統一編號',
             place7: '請輸入統編或其他政府核發的機構統一編號',
-            place8: '请输入您的Email',
+            place8: '請輸入您的Email',
             submit: '提交申請',
             submit: '提交申請',
             submitSuc: '已成功提交申請!',
             submitSuc: '已成功提交申請!',
             errTip1: '請選擇正確的地區!',
             errTip1: '請選擇正確的地區!',

+ 4 - 0
TEAMModelOS/ClientApp/src/components/student-web/HomeView/HomeView.less

@@ -243,5 +243,9 @@
         .home-head .join-class {
         .home-head .join-class {
             width: 80%;
             width: 80%;
         }
         }
+
+        .no-data {
+            min-height: 300px;
+        }
     }
     }
 }
 }

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-web/HomeView/newHomeView.vue

@@ -184,7 +184,7 @@
                         </div>
                         </div>
                         <div class="other-box">
                         <div class="other-box">
                             <vuescroll>
                             <vuescroll>
-                                <div v-if="!allNotice.length" class="no-data-notice">
+                                <div v-if="!allNotice.length" class="no-data">
                                     <img src="./noData.png" alt="">
                                     <img src="./noData.png" alt="">
                                     <p>{{ $t("studentWeb.public.noData") }}</p>
                                     <p>{{ $t("studentWeb.public.noData") }}</p>
                                 </div>
                                 </div>

+ 22 - 0
TEAMModelOS/ClientApp/src/view/login/page/Student.less

@@ -255,4 +255,26 @@
 }
 }
 .other-login-text{
 .other-login-text{
     font-size: 12px;
     font-size: 12px;
+}
+
+
+@media screen and (max-width: 768px) {
+    .loginDiv {
+        margin-top: 0;
+    }
+    .right-box {
+        flex-direction: column-reverse;
+        height: auto;
+    }
+
+    .tmd-login-box {
+        margin-right: 0;
+    }
+
+    .school-login-box {
+        margin-left: 0;
+        padding-bottom: 20px;
+        margin-bottom: 20px;
+        border-bottom: 1px dashed #ccc;
+    }
 }
 }

+ 3 - 1
TEAMModelOS/Filter/AuthTokenAttribute.cs

@@ -103,7 +103,9 @@ namespace TEAMModelOS.Filter
                     }
                     }
                     string ip = IpPort.Split(":")[0];
                     string ip = IpPort.Split(":")[0];
                     var path = context.HttpContext.Request.Path;
                     var path = context.HttpContext.Request.Path;
-                    if (!$"{path}".Contains("used-space")) {
+                    if (!$"{path}".Contains("blob/used-space") && !$"{path}".Contains("item/upsert") && !$"{path}".Contains("item/upsert-all")
+                         && !$"{path}".Contains("blob/sas-r") && !$"{path}".Contains("blob/sas-rcwld") && !$"{path}".Contains("blob/sas-url-r")) 
+                    {
                         string key = $"IES5:BlackList:Token:{id}{school}{scope}:{ip}";
                         string key = $"IES5:BlackList:Token:{id}{school}{scope}:{ip}";
                         var BTKExists = _azureRedis.GetRedisClient(8).KeyExists(key);
                         var BTKExists = _azureRedis.GetRedisClient(8).KeyExists(key);
                         if (BTKExists)
                         if (BTKExists)