소스 검색

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

jeff 1 년 전
부모
커밋
877a053f48

+ 65 - 62
TEAMModelBI/ClientApp/src/view/userInquire/idIncrement.vue

@@ -171,7 +171,7 @@
   <script setup>
   import option_cn from '@/static/regions/region_cn.json'
   import option_gl from '@/static/regions/region_gl.json'
-  import testAPIData from '@/static/regions/test.json'
+  //import testAPIData from '@/static/regions/test.json'
   import { ref, reactive , getCurrentInstance, watch, h, nextTick } from 'vue'
   import { ElMessage, TableV2SortOrder, ElLoading, ElCheckbox,HeaderCellSlotProps,ElPopover} from 'element-plus'
   import { Filter } from '@element-plus/icons'  
@@ -355,7 +355,8 @@
   let filterData = ref([])
   let allData = reactive([])
   let statisticsData = reactive([])
-  let statisticsDatastr = testAPIData
+  let statisticsDatastr = reactive([])
+  //let statisticsDatastr = testAPIData
   let schDetailData = reactive([])
   let geoDetailData = reactive([])  
   let schDetailColumns = ref([
@@ -406,8 +407,8 @@
 ])
   // 取行政區資料
   const siteValue = window.location.host === 'localhost:5001' ? 'cn' : window.location.host === 'bi.teammodel.cn' ? 'cn' : window.location.host === 'bitest.teammodel.cn' ? 'cn' : 'international'
-  //const optionsData = siteValue === 'cn' ? option_cn : option_gl
-  const optionsData = option_gl 
+  const optionsData = siteValue === 'cn' ? option_cn : option_gl
+  //const optionsData = option_gl 
   const props2 = {
   multiple: true,
   checkStrictly: false,
@@ -551,64 +552,64 @@
       dateList:montharr
     }    
     
-     for (let i = 0; i < statisticsDatastr.length; i++) {
-       let item = {
-         dateFrom: "",
-         dateTo: "",
-         newInSeat: 0,
-         alreadyInSeat: 0,
-         schInSeat: 0,
-         geoInSeat: 0,
-       }
+    //  for (let i = 0; i < statisticsDatastr.length; i++) {
+    //    let item = {
+    //      dateFrom: "",
+    //      dateTo: "",
+    //      newInSeat: 0,
+    //      alreadyInSeat: 0,
+    //      schInSeat: 0,
+    //      geoInSeat: 0,
+    //    }
 
-       statisticsDatastr[i].sch.forEach(function (school, index2) {
-         if (school.name) {
-           item.alreadyInSeat += school.tmids.length;
-         }
-       })
-       item.dateFrom = statisticsDatastr[i].dateFrom;
-       item.dateTo = statisticsDatastr[i].dateTo;
-       item.newInSeat = statisticsDatastr[i].tmid.length;
-       item.schInSeat = statisticsDatastr[i].sch.length;
-       item.geoInSeat = statisticsDatastr[i].geo.length;
-       statisticsData.push(item);
-     }
+    //    statisticsDatastr[i].sch.forEach(function (school, index2) {
+    //      if (school.name) {
+    //        item.alreadyInSeat += school.tmids.length;
+    //      }
+    //    })
+    //    item.dateFrom = statisticsDatastr[i].dateFrom;
+    //    item.dateTo = statisticsDatastr[i].dateTo;
+    //    item.newInSeat = statisticsDatastr[i].tmid.length;
+    //    item.schInSeat = statisticsDatastr[i].sch.length;
+    //    item.geoInSeat = statisticsDatastr[i].geo.length;
+    //    statisticsData.push(item);
+    //  }
      
-     searchLoading.value = false;    
-     console.log("statisticsData : "+statisticsData);         
+    //  searchLoading.value = false;    
+    //  console.log("statisticsData : "+statisticsData);         
 
-    // proxy.$api.getTmidUseprod(data).then(async(res) => {      
-    //   if(res.length > 0){
-    //     for (let i = 0; i < res.length; i++) {
-    //       let item = {
-    //         dateFrom: "",
-    //         dateTo:"",
-    //         newInSeat: 0,
-    //         alreadyInSeat: 0,
-    //         schInSeat: 0,
-    //         geoInSeat: 0,
-    //       }
+    proxy.$api.getTmidUseprod(data).then(async(res) => {      
+      if(res.length > 0){
+        for (let i = 0; i < res.length; i++) {
+          let item = {
+            dateFrom: "",
+            dateTo:"",
+            newInSeat: 0,
+            alreadyInSeat: 0,
+            schInSeat: 0,
+            geoInSeat: 0,
+          }
 
-    //       res[i].sch.forEach(function (school, index2) {
-    //         if (school.name) {
-    //           item.alreadyInSeat += school.tmids.length;
-    //         }
-    //       })
-    //       item.dateFrom = res[i].dateFrom
-    //       item.dateTo = res[i].dateTo
-    //       item.newInSeat = res[i].tmid.length;          
-    //       item.schInSeat = res[i].sch.length;
-    //       item.geoInSeat = res[i].geo.length;
-    //       statisticsData.push(item);
-    //     }                
-    //   }
-    //   allData = res;
-    //   statisticsDatastr = res;
-    //   //await FilterData();          
-    //   searchLoading.value=false;
-    // }).catch((err) => {
-    //   ElMessage.error('API异常,数据获取失败')
-    // })
+          res[i].sch.forEach(function (school, index2) {
+            if (school.name) {
+              item.alreadyInSeat += school.tmids.length;
+            }
+          })
+          item.dateFrom = res[i].dateFrom
+          item.dateTo = res[i].dateTo
+          item.newInSeat = res[i].tmid.length;          
+          item.schInSeat = res[i].sch.length;
+          item.geoInSeat = res[i].geo.length;
+          statisticsData.push(item);
+        }                
+      }
+      allData = res;
+      statisticsDatastr = res;
+      //await FilterData();          
+      searchLoading.value=false;
+    }).catch((err) => {
+      ElMessage.error('API异常,数据获取失败')
+    })
   }
   function timeChange (value) {
     console.log(value, productData.value.timevalue)
@@ -620,7 +621,7 @@
     times.end = productData.value.timevalue[1];
     let yearValues = ''
 
-    if (clickNum.value.time === 1) {// 如果是月份模式
+    if (clickNum.value.time === 0) {// 如果是月份模式
       // 取得開始的年跟月
       const sparts = times.start.split("-");
       const syear = parseInt(sparts[0]);
@@ -643,9 +644,9 @@
       times.end = `${eyear}-${e1month}-${eday}`;
       // 获取下个月的第 0 天,即当前月的最后一天
       //times.end = new Date(eyear, emonth, 0);
-    }
+    }    
 
-    if (clickNum.value.time === 2) {// 如果是年份模式
+    if (clickNum.value.time === 1) {// 如果是年份模式
       yearValues = productData.value.timevalue.slice(0, 4),
         times.start = productData.value.timevalue,
         times.end = yearValues + '-12-31'
@@ -826,7 +827,9 @@ function FilterData () {
         detailData.newInSeat = items.newInSeat;
         detailData.geoInSeat = items.geoInSeat;
         detailData.alreadyInSeat = items.alreadyInSeat;
-        detailData.schInSeat = items.schInSeat;        
+        detailData.schInSeat = items.schInSeat;
+        schDetailData.splice(0, schDetailData.length);
+        geoDetailData.splice(0, geoDetailData.length);   
         
         statisticsDatastr[i].sch.forEach((item) => { // 列出學校資料
           if (item.name) {

+ 49 - 22
TEAMModelBI/Filter/RequestAuditFilter.cs

@@ -6,12 +6,9 @@ using System.Threading.Tasks;
 using TEAMModelOS.SDK.Extension;
 using Microsoft.Extensions.Logging;
 using TEAMModelOS.SDK;
-using DocumentFormat.OpenXml.Office2010.Excel;
-using DocumentFormat.OpenXml.Wordprocessing;
 using System.IdentityModel.Tokens.Jwt;
 using System.Linq;
 using Azure.Core;
-using DocumentFormat.OpenXml.Office2016.Excel;
 using TEAMModelOS.SDK.DI;
 using Microsoft.Extensions.Primitives;
 using HTEXLib.Helpers.ShapeHelpers;
@@ -24,11 +21,13 @@ namespace TEAMModelOS.Filter
         private readonly HttpTrigger _httpTrigger;
         public RequestAuditFilter(/*ILoggerFactory loggerFactory*/HttpTrigger httpTrigger)
         {
-          //  _logger = loggerFactory.CreateLogger<RequestAuditFilter>();
+            //  _logger = loggerFactory.CreateLogger<RequestAuditFilter>();
             _httpTrigger = httpTrigger;
         }
         public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
         {
+            string id = string.Empty, name = string.Empty, picture = string.Empty, school = string.Empty, scope = string.Empty, roles = string.Empty;
+
             //============== 这里是执行方法之前获取数据 ====================
 
             // 获取控制器、路由信息
@@ -39,17 +38,18 @@ namespace TEAMModelOS.Filter
 
             // 获取 HttpContext 和 HttpRequest 对象
             var httpContext = context.HttpContext;
+            string ua = httpContext.GetUserAgent();
             var httpRequest = httpContext.Request;
 
             // 获取客户端 Ipv4 地址
             var remoteIPv4 = httpContext.GetRemoteIpAddressToIPv4();
 
             // 获取请求的 Url 地址
-           // var requestUrl = httpRequest.GetRequestUrlAddress();
+            // var requestUrl = httpRequest.GetRequestUrlAddress();
+
 
-            
             // 获取来源 Url 地址
-           var refererUrl = httpRequest.GetRefererUrlAddress();
+            var refererUrl = httpRequest.GetRefererUrlAddress();
 
             // 获取请求参数(写入日志,需序列化成字符串后存储)
             var parameters = context.ActionArguments;
@@ -57,29 +57,54 @@ namespace TEAMModelOS.Filter
             // 获取操作人(必须授权访问才有值)"userId" 为你存储的 claims type,jwt 授权对应的是 payload 中存储的键名
             //var userId = httpContext.User?.FindFirstValue("userId");
             var authtoken = context.HttpContext.GetXAuth("AuthToken");
-            string tokenSha = string.Empty,client = string.Empty;
-            if (context.HttpContext.Request.Headers.TryGetValue("Authorization", out StringValues Authorization)) 
+            string tokenSha = string.Empty, client = string.Empty;
+            if (context.HttpContext.Request.Headers.TryGetValue("Authorization", out StringValues Authorization))
+            {
+                var jwt = new JwtSecurityTokenHandler().ReadJwtToken(Authorization.ToString().Replace("Bearer ", ""));
+                client= roles = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("roles"))?.Value;
+                tokenSha= ShaHashHelper.GetSHA1(Authorization.ToString());
+            }
+            if (context.HttpContext.Request.Headers.TryGetValue("X-Auth-IdToken", out StringValues XAuthIdToken))
+            {
+                var jwt = new JwtSecurityTokenHandler().ReadJwtToken(XAuthIdToken);
+                id = jwt.Payload.Sub;
+                name = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("name"))?.Value;
+                if (string.IsNullOrEmpty(tokenSha))
+                {
+                    tokenSha= ShaHashHelper.GetSHA1(XAuthIdToken.ToString());
+                }
+            }
+            if (context.HttpContext.Request.Headers.TryGetValue("X-Auth-School", out StringValues XAuthSchool))
             {
-                try {
-                    string token = Authorization.ToString().Replace("Bearer ", "");
-                    var jwt = new JwtSecurityTokenHandler().ReadJwtToken(token);
-                      tokenSha = ShaHashHelper.GetSHA1(token);
-                    client = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("roles"))?.Value;
-                } catch (Exception ex ) { }
+                try
+                {
+                    school = XAuthSchool.ToString();
+                }
+                catch (Exception ex) { }
             }
-            string id = string.Empty, name = string.Empty, picture = string.Empty, school = string.Empty, scope = string.Empty;
-            if (!string.IsNullOrWhiteSpace(authtoken)) {
+
+            if (!string.IsNullOrWhiteSpace(authtoken))
+            {
                 var jwt = new JwtSecurityTokenHandler().ReadJwtToken(authtoken);
                 id = jwt.Payload.Sub;
                 school = jwt.Payload.Azp;
                 name = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("name"))?.Value;
                 scope = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("scope"))?.Value;
+                if (string.IsNullOrEmpty(tokenSha))
+                {
+                    tokenSha= ShaHashHelper.GetSHA1(authtoken);
+                }
             }
             string secChUaPlatform = string.Empty;
             if (httpContext.Request.Headers.TryGetValue("Sec-Ch-Ua-Platform", out var values))
             {
                 secChUaPlatform = values.FirstOrDefault();
             }
+            if (string.IsNullOrEmpty(tokenSha))
+
+            {
+                tokenSha= ShaHashHelper.GetSHA1($"{ua}{remoteIPv4}{httpRequest.Host}{secChUaPlatform}");
+            }
             // 请求时间
             var requestedTime = DateTimeOffset.Now.GetGMTTime(8).ToUnixTimeMilliseconds();
             //============== 这里是执行方法之后获取数据 ====================
@@ -95,9 +120,10 @@ namespace TEAMModelOS.Filter
             // string region = await _searcher.SearchIpAsync(remoteIPv4);
             //同一个账号,同一IP,同一接口,UA标识(UA标识随意切换则表示可能会存在DDOS),时间段
             //_logger.LogInformation(new{ ua=httpContext.GetUserAgent(), ip=remoteIPv4,time=requestedTime,path =$"{httpRequest.PathBase}{httpRequest.Path}",host= $"{httpRequest.Host}", param=parameters,id ,name ,school,succeed =isRequestSucceed }.ToJsonString());
+
             var data = new
             {
-                ua = httpContext.GetUserAgent(),
+                //ua =ua,
                 ip = remoteIPv4,
                 time = requestedTime,
                 path = $"{httpRequest.PathBase}{httpRequest.Path}",
@@ -109,12 +135,13 @@ namespace TEAMModelOS.Filter
                 client = client,
                 tid = tokenSha,
                 scope = scope,
-                referer = refererUrl,
-                platform = secChUaPlatform,
-                p = "bi",
+                // referer = refererUrl,
+                //platform = secChUaPlatform,
+                p = "os",
+                //idToken=XAuthIdToken
             };
             _= _httpTrigger.RequestHttpTrigger(data, "China", "http-log");
-            
+
         }
     }
 }

+ 3 - 3
TEAMModelBI/TEAMModelBI.csproj

@@ -65,9 +65,9 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>5.2403.6</Version>
-		<AssemblyVersion>5.2403.6.1</AssemblyVersion>
-		<FileVersion>5.2403.6.1</FileVersion>
+		<Version>5.2403.13</Version>
+		<AssemblyVersion>5.2403.13.1</AssemblyVersion>
+		<FileVersion>5.2403.13.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记2022000908</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>

+ 3 - 3
TEAMModelOS.FunctionV4/TEAMModelOS.FunctionV4.csproj

@@ -5,9 +5,9 @@
 		<OutputType>Exe</OutputType>
 		<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
 		<SignAssembly>true</SignAssembly>
-		<Version>5.2403.6</Version>
-		<AssemblyVersion>5.2403.6.1</AssemblyVersion>
-		<FileVersion>5.2403.6.1</FileVersion>
+		<Version>5.2403.13</Version>
+		<AssemblyVersion>5.2403.13.1</AssemblyVersion>
+		<FileVersion>5.2403.13.1</FileVersion>
 		<PackageId>TEAMModelOS.FunctionV4</PackageId>
 		<Authors>teammodel</Authors>
 		<Company>醍摩豆(成都)信息技术有限公司</Company>

+ 3 - 3
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -2,9 +2,9 @@
 
   <PropertyGroup>
     <TargetFramework>net6.0</TargetFramework>
-    <Version>5.2403.6</Version>
-    <AssemblyVersion>5.2403.6.1</AssemblyVersion>
-    <FileVersion>5.2403.6.1</FileVersion>
+    <Version>5.2403.13</Version>
+    <AssemblyVersion>5.2403.13.1</AssemblyVersion>
+    <FileVersion>5.2403.13.1</FileVersion>
     <PackageReleaseNotes>发版</PackageReleaseNotes>
   </PropertyGroup>
 

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

@@ -1102,7 +1102,7 @@ const LANG_EN_US = {
         createTips2: 'Note: You (not yet a member of a school) can allow students to join the course by entering the course invitation code, scanning the course QR code, or using the invitation link.',
         renameListTitle: 'Edit List Name',
         selectListTips: 'Please select a list',
-        renameRepeat: 'List name is duplicate',
+        renameRepeat: 'A list with the same name already exists',
         alreadyExist: ' already existed',
         listAPIErr: 'Failed to get the list',
         rmvListTips: 'Note: The current list is also being used in other courses',
@@ -1709,7 +1709,7 @@ const LANG_EN_US = {
                 image:'Picture',
                 file:'File',
                 audio: 'Audio',
-                autoScore: 'Automatic Scoring',
+                autoScore: 'Automatic Rating',
                 answerLang: 'Language',
                 us: 'English',
                 zh: 'Mandarin',

+ 1 - 0
TEAMModelOS/ClientApp/src/view/classmgt/ClassStudent.less

@@ -133,6 +133,7 @@
 .list-group {
     min-height: 180px;
     padding-top:5px;
+    max-height: 400px;
 }
 .item-tools{
     display: none;

+ 6 - 2
TEAMModelOS/ClientApp/src/view/classrecord/eventchart/SmartRating.vue

@@ -280,7 +280,7 @@ export default {
     }
 }
 .smart-list {
-    width: 150px;
+    // width: 150px;
     text-align: center;
     margin-right: 20px;
 
@@ -295,7 +295,7 @@ export default {
         overflow: hidden;
         text-overflow: ellipsis;
         white-space: nowrap;
-        width: 150px;
+        // width: 150px;
     }
 }
 </style>
@@ -321,4 +321,8 @@ export default {
         height: 100%;
     }
 }
+.smart-list .smart-material svg {
+    width: 200px;
+    height: auto;
+}
 </style>

+ 3 - 2
TEAMModelOS/ClientApp/src/view/classrecord/eventchart/SubjectiveAns.vue

@@ -118,13 +118,14 @@ export default {
 
         .student-name {
             margin-right: 5px;
+            color: #2b85e4;
         }
     }
 }
 .popques-img img{
     cursor: pointer;
-    width: 100px !important;
-    height: 100px !important;
+    width: 200px !important;
+    height: auto;
 }
 </style>
 <style lang="less">

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/bank/index.vue

@@ -31,7 +31,7 @@
               <Icon type="md-hand" size="16" />
               <span>{{ $t('evaluation.index.manualCreate') }}</span>
             </span>
-            <span @click="goXkwPick()" class="bank-tools-btn" v-show="hasXkwAuth && !inGlobalSite">
+            <span @click="goXkwPick()" class="bank-tools-btn" v-show="hasXkwAuth && !inGlobalSite && isSchool">
               <Icon type="ios-send" size="16" />
               <span>{{ $t('evaluation.xkwMode') }}</span>
             </span>

+ 281 - 74
TEAMModelOS/Controllers/System/BillController.cs

@@ -18,6 +18,7 @@ using OfficeOpenXml;
 using OpenXmlPowerTools;
 using StackExchange.Redis;
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.IdentityModel.Tokens.Jwt;
@@ -38,6 +39,7 @@ using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Helper.Common.JsonHelper;
 using TEAMModelOS.SDK.Helper.Common.JsonHelper.JsonPath;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BISchool;
+using Top.Api;
 
 namespace TEAMModelOS.Controllers
 {
@@ -75,7 +77,23 @@ namespace TEAMModelOS.Controllers
         [RequestSizeLimit(102_400_000_00)] //最大10000m左右
         public async Task<IActionResult> ReportApi(JsonElement json)
         {
-
+            var untyped = new JsonParser().Parse(json.GetRawText());
+            var selection = new JsonPathSelection(untyped);
+            {
+                var nodes_id_token = selection.SelectNodes(json.GetProperty("path").GetString());
+                foreach (var node in nodes_id_token)
+                {
+                    if (node.Value is string)
+                    {
+                        Console.WriteLine(node.Value);
+                    }
+                    else
+                    {
+                        return Ok(node);
+                    }
+                }
+                //return Ok(nodes_id_token);
+            }
             List<string> times = json.GetProperty("times").ToObject<List<string>>();
             foreach (var time in times)
             {
@@ -111,7 +129,7 @@ namespace TEAMModelOS.Controllers
 
                         }
                     }
-                    List<(string tmd, bool exists)> tmdexists = new List<(string tmd, bool exists)>();
+                    List<(string tmd, bool exists, string scope)> tmdexists = new List<(string tmd, bool exists, string scope)>();
                     List<(string sch, bool exists)> schexists = new List<(string sch, bool exists)>();
                     var tmds = uuidInfos.SelectMany(x => x.tmdid).ToHashSet();
                     if (tmds.Any())
@@ -119,7 +137,15 @@ namespace TEAMModelOS.Controllers
                         foreach (var tmd in tmds)
                         {
                             var exists = await _azureRedis.GetRedisClient().KeyExistsAsync($"Blob:Catalog:{tmd}");
-                            tmdexists.Add((tmd, exists));
+                            if (exists)
+                            {
+                                tmdexists.Add((tmd, exists, "teacher"));
+                            }
+                            else
+                            {
+                                exists = await _azureRedis.GetRedisClient().KeyExistsAsync($"Login:School:hbcn:student:{tmd}");
+                                tmdexists.Add((tmd, exists, "student"));
+                            }
                         }
                     }
                     var schs = uuidInfos.SelectMany(x => x.school).ToHashSet();
@@ -142,6 +168,10 @@ namespace TEAMModelOS.Controllers
                                 if (vist!= null)
                                 {
                                     vist.userId=tmd;
+                                    if (string.IsNullOrWhiteSpace(vist.scope))
+                                    {
+                                        vist.scope=tmdext.scope;
+                                    }
                                 }
                                 break;
                             }
@@ -180,6 +210,70 @@ namespace TEAMModelOS.Controllers
                 {
                     var untyped = new JsonParser().Parse(log.param.GetRawText());
                     var selection = new JsonPathSelection(untyped);
+                    string path = "$..[id_token,idToken,idtoken,tmdid,id,teacherId,teacher,tid,tId,userid,userId,code,studentId,student,studentid]";
+                    
+                    var nodes_path = selection.SelectNodes(path);
+                    foreach (var node in nodes_path)
+                    {
+                        // 只获取是字符串的 
+                        if (node.Value is string)
+                        {
+                            switch (true) 
+                            {
+                                case bool when node.Path.Contains("id_token")||node.Path.Contains("idToken")||node.Path.Contains("idtoken"):
+                                    {
+                                        try
+                                        {
+                                            var jwt = new JwtSecurityToken($"{node.Value}");
+                                            string id = jwt.Payload.Sub;
+                                            var name = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("name"))?.Value;
+                                            if (!string.IsNullOrWhiteSpace(id) && long.TryParse(id, out long _id))
+                                            {
+                                                useridMatch.Add(id);
+                                            }
+                                        }
+                                        catch (Exception ex) { }
+                                        break;
+                                    }
+                                case bool when node.Path.Contains("tmdid")||node.Path.Contains("id")||node.Path.Contains("teacherId")
+                                ||node.Path.Contains("teacher")||node.Path.Contains("tid")||node.Path.Contains("tId")||node.Path.Contains("userid")
+                                ||node.Path.Contains("userId")||node.Path.Contains("studentId")||node.Path.Contains("student")||node.Path.Contains("studentid"):
+                                    {
+                                        if (!string.IsNullOrWhiteSpace($"{node.Value}") && long.TryParse($"{node.Value}", out long _id))
+                                        {
+                                            useridMatch.Add($"{node.Value}");
+                                        }
+                                        break;
+                                    }
+                                case bool when node.Path.Contains("code"):
+                                    {
+                                        if (!string.IsNullOrWhiteSpace($"{node.Value}"))
+                                        {
+                                            if (long.TryParse($"{node.Value}", out long _id))
+                                            {
+                                                useridMatch.Add($"{node.Value}");
+                                            }
+                                            else
+                                            {
+                                                string[] codes = $"{node.Value}".Split("-");
+                                                foreach (var _code in codes)
+                                                {
+                                                    if (long.TryParse(_code, out long _codeid))
+                                                    {
+                                                        useridMatch.Add($"{_code}");
+                                                        break;
+                                                    }
+                                                }
+                                            }
+                                        }
+                                        break; 
+                                    }
+                            }
+                        }
+                    }
+
+                    /*
+                     
                     {
                         var nodes_id_token = selection.SelectNodes("$.request.id_token");
                         if (nodes_id_token.Count()>0)
@@ -353,91 +447,202 @@ namespace TEAMModelOS.Controllers
                         }
                     }
                     // }
+                     */
                 }
                 if (string.IsNullOrWhiteSpace(vist.school))
                 {
                     var untyped = new JsonParser().Parse(log.param.GetRawText());
                     var selection = new JsonPathSelection(untyped);
+
+                    string path = "$..[school,id,schoolId,schoolid,schoolCode,school_code,schoolcode,code]";
+                    var nodes_path = selection.SelectNodes(path);
+                    foreach (var node in nodes_path)
                     {
-                        var nodes_school = selection.SelectNodes("$.request.school");
-                        if (nodes_school.Count()>0)
+                        // 只获取是字符串的 
+                        if (node.Value is string)
                         {
-                            if (!string.IsNullOrWhiteSpace($"{nodes_school[0].Value}")  && $"{nodes_school[0].Value}".Length<=8)
+                            switch (true)
                             {
-                                schoolMatch.Add($"{nodes_school[0].Value}");
+                                case bool when node.Path.Contains("school")||node.Path.Contains("id")||node.Path.Contains("schoolId")
+                                ||node.Path.Contains("schoolid")||node.Path.Contains("schoolCode")||node.Path.Contains("school_code")||node.Path.Contains("schoolcode"):
+                                    { break; }
+                                case bool when node.Path.Contains("code"):
+                                    {
+                                        if (!$"{node.Value}".Contains("-")&&  $"{node.Value}".Length<=8)
+                                        {
+                                            schoolMatch.Add($"{node.Value}");
+                                        }
+                                        else
+                                        {
+                                            string[] codes = $"{node.Value}".Split("-");
+                                            foreach (var _code in codes)
+                                            {
+                                                if ($"{node.Value}".Length<=8)
+                                                {
+                                                    schoolMatch.Add($"{_code}");
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                        break; 
+                                    }
+                              
                             }
                         }
+
                     }
-                    var nodes_id = selection.SelectNodes("$.request.id");
-                    if (nodes_id.Count()>0)
+
+                    /*
+                      {
+                         var nodes_school = selection.SelectNodes("$.request.school");
+                         if (nodes_school.Count()>0)
+                         {
+                             if (!string.IsNullOrWhiteSpace($"{nodes_school[0].Value}")  && $"{nodes_school[0].Value}".Length<=8)
+                             {
+                                 schoolMatch.Add($"{nodes_school[0].Value}");
+                             }
+                         }
+                     }
+                     var nodes_id = selection.SelectNodes("$.request.id");
+                     if (nodes_id.Count()>0)
+                     {
+                         if (!string.IsNullOrWhiteSpace($"{nodes_id[0].Value}")  && $"{nodes_id[0].Value}".Length<=8)
+                         {
+                             schoolMatch.Add($"{nodes_id[0].Value}");
+                         }
+                     }
+                     var nodes_schoolId = selection.SelectNodes("$.request.schoolId");
+                     if (nodes_schoolId.Count()>0)
+                     {
+                         if (!string.IsNullOrWhiteSpace($"{nodes_schoolId[0].Value}")  && $"{nodes_schoolId[0].Value}".Length<=8)
+                         {
+                             schoolMatch.Add($"{nodes_schoolId[0].Value}");
+                         }
+                     }
+                     var nodes_schoolid = selection.SelectNodes("$.request.schoolid");
+                     if (nodes_schoolid.Count()>0)
+                     {
+                         if (!string.IsNullOrWhiteSpace($"{nodes_schoolid[0].Value}")  && $"{nodes_schoolid[0].Value}".Length<=8)
+                         {
+                             schoolMatch.Add($"{nodes_schoolid[0].Value}");
+                         }
+                     }
+                     var nodes_schoolCode = selection.SelectNodes("$.request.schoolCode");
+                     if (nodes_schoolCode.Count()>0)
+                     {
+                         if (!string.IsNullOrWhiteSpace($"{nodes_schoolCode[0].Value}")  && $"{nodes_schoolCode[0].Value}".Length<=8)
+                         {
+                             schoolMatch.Add($"{nodes_schoolCode[0].Value}");
+                         }
+                     }
+                     var nodes_school_code = selection.SelectNodes("$.request.school_code");
+                     if (!string.IsNullOrWhiteSpace($"{nodes_school_code[0].Value}")  && $"{nodes_school_code[0].Value}".Length<=8)
+                     {
+                         schoolMatch.Add($"{nodes_school_code[0].Value}");
+                     }
+                     var nodes_schoolcode = selection.SelectNodes("$.request.schoolcode");
+                     if (!string.IsNullOrWhiteSpace($"{nodes_schoolcode[0].Value}")  && $"{nodes_schoolcode[0].Value}".Length<=8)
+                     {
+                         schoolMatch.Add($"{nodes_schoolcode[0].Value}");
+                     }
+                     var nodes_code = selection.SelectNodes("$.request.code");
+                     if (!string.IsNullOrWhiteSpace($"{nodes_code[0].Value}"))
+                     {
+                         if (!$"{nodes_code[0].Value}".Contains("-")&&  $"{nodes_code[0].Value}".Length<=8)
+                         {
+                             //vist.userId=$"{nodes_code[0].Value}";
+                             schoolMatch.Add($"{nodes_code[0].Value}");
+                         }
+                         else
+                         {
+                             string[] codes = $"{nodes_code[0].Value}".Split("-");
+                             foreach (var _code in codes)
+                             {
+                                 if ($"{nodes_code[0].Value}".Length<=8)
+                                 {
+                                     schoolMatch.Add(vist.userId=$"{_code}");
+                                     // vist.userId=$"{_code}";
+                                     break;
+                                 }
+                             }
+                         }
+
+                     }
+                     */
+                }
+
+
+                uuidInfo.Add((uuid, useridMatch, schoolMatch));
+                vists.Add(vist);
+                //补全站点
+                {
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("teammodelos-yx.chinacloudsites.cn")||log.host.Equals("teammodelos.chinacloudsites.cn")
+                        ||log.host.Equals("yx.teammodel.cn")||log.host.Equals("scyx.teammodel.cn")  ||log.host.Equals("jinniu.teammodel.cn")))
                     {
-                        if (!string.IsNullOrWhiteSpace($"{nodes_id[0].Value}")  && $"{nodes_id[0].Value}".Length<=8)
-                        {
-                            schoolMatch.Add($"{nodes_id[0].Value}");
-                        }
+                        log.host="www.teammodel.cn";
                     }
-                    var nodes_schoolId = selection.SelectNodes("$.request.schoolId");
-                    if (nodes_schoolId.Count()>0)
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("teammodelos-rc.chinacloudsites.cn")))
                     {
-                        if (!string.IsNullOrWhiteSpace($"{nodes_schoolId[0].Value}")  && $"{nodes_schoolId[0].Value}".Length<=8)
-                        {
-                            schoolMatch.Add($"{nodes_schoolId[0].Value}");
-                        }
+                        log.host="rc.teammodel.cn";
                     }
-                    var nodes_schoolid = selection.SelectNodes("$.request.schoolid");
-                    if (nodes_schoolid.Count()>0)
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("teammodelos-test.chinacloudsites.cn") || log.host.Equals("zhiyin-test.teammodel.cn")))
                     {
-                        if (!string.IsNullOrWhiteSpace($"{nodes_schoolid[0].Value}")  && $"{nodes_schoolid[0].Value}".Length<=8)
-                        {
-                            schoolMatch.Add($"{nodes_schoolid[0].Value}");
-                        }
+                        log.host="test.teammodel.cn";
                     }
-                    var nodes_schoolCode = selection.SelectNodes("$.request.schoolCode");
-                    if (nodes_schoolCode.Count()>0)
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("teammodelbi-test.chinacloudsites.cn")))
                     {
-                        if (!string.IsNullOrWhiteSpace($"{nodes_schoolCode[0].Value}")  && $"{nodes_schoolCode[0].Value}".Length<=8)
-                        {
-                            schoolMatch.Add($"{nodes_schoolCode[0].Value}");
-                        }
+                        log.host="bitest.teammodel.cn";
                     }
-                    var nodes_school_code = selection.SelectNodes("$.request.school_code");
-                    if (!string.IsNullOrWhiteSpace($"{nodes_school_code[0].Value}")  && $"{nodes_school_code[0].Value}".Length<=8)
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("teammodelbi.chinacloudsites.cn")))
                     {
-                        schoolMatch.Add($"{nodes_school_code[0].Value}");
+                        log.host="bi.teammodel.cn";
                     }
-                    var nodes_schoolcode = selection.SelectNodes("$.request.schoolcode");
-                    if (!string.IsNullOrWhiteSpace($"{nodes_schoolcode[0].Value}")  && $"{nodes_schoolcode[0].Value}".Length<=8)
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("teamcontest.chinacloudsites.cn")))
                     {
-                        schoolMatch.Add($"{nodes_schoolcode[0].Value}");
+                        log.host="bi.teammodel.cn";
                     }
-                    var nodes_code = selection.SelectNodes("$.request.code");
-                    if (!string.IsNullOrWhiteSpace($"{nodes_code[0].Value}"))
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("contest.chinacloudsites.cn")))
                     {
-                        if (!$"{nodes_code[0].Value}".Contains("-")&&  $"{nodes_code[0].Value}".Length<=8)
-                        {
-                            //vist.userId=$"{nodes_code[0].Value}";
-                            schoolMatch.Add($"{nodes_code[0].Value}");
-                        }
-                        else
-                        {
-                            string[] codes = $"{nodes_code[0].Value}".Split("-");
-                            foreach (var _code in codes)
-                            {
-                                if ($"{nodes_code[0].Value}".Length<=8)
-                                {
-                                    schoolMatch.Add(vist.userId=$"{_code}");
-                                    // vist.userId=$"{_code}";
-                                    break;
-                                }
-                            }
-                        }
-
+                        log.host="contest.teammodel.cn";
+                    }
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("contest-test.chinacloudsites.cn")))
+                    {
+                        log.host="contest-test.teammodel.cn";
+                    }
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("hiteachcc.chinacloudsites.cn")))
+                    {
+                        log.host="hiteachcc.teammodel.cn";
+                    }
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("appraisal.chinacloudsites.cn")))
+                    {
+                        log.host="appraisal.teammodel.cn";
+                    }
+                    if (!string.IsNullOrWhiteSpace(log.host)
+                        &&(log.host.Equals("appraisal-test.chinacloudsites.cn")))
+                    {
+                        log.host="appraisal-test.teammodel.cn";
                     }
                 }
-                
 
-                uuidInfo.Add((uuid, useridMatch, schoolMatch));
-                vists.Add(vist);
+                if (log.host.Equals("localhost")  &&  log.p.Equals("os")) 
+                {
+                    log.host="test.teammodel.cn";
+                }
+                else  if (log.host.Equals("localhost")  && ( log.p.Equals("bi")))
+                {
+                    log.host="bitest.teammodel.cn";
+                }
+                vist.host= log.host;
             }
             return (vists, uuidInfo);
         }
@@ -1037,7 +1242,7 @@ namespace TEAMModelOS.Controllers
             /// <summary>
             /// 
             /// </summary>
-           // public string MeterRegion { get; set; }
+            // public string MeterRegion { get; set; }
             /// <summary>
             /// 
             /// </summary>
@@ -1045,11 +1250,11 @@ namespace TEAMModelOS.Controllers
             /// <summary>
             /// 
             /// </summary>
-           // public double ConsumedQuantity { get; set; }
+            // public double ConsumedQuantity { get; set; }
             /// <summary>
             /// 
             /// </summary>
-           // public double ResourceRate { get; set; }
+            // public double ResourceRate { get; set; }
             /// <summary>
             /// 
             /// </summary>
@@ -1057,7 +1262,7 @@ namespace TEAMModelOS.Controllers
             /// <summary>
             /// 
             /// </summary>
-           // public string ResourceLocation { get; set; }
+            // public string ResourceLocation { get; set; }
             /// <summary>
             /// 
             /// </summary>
@@ -1069,31 +1274,31 @@ namespace TEAMModelOS.Controllers
             /// <summary>
             /// 
             /// </summary>
-           // public string ServiceInfo1 { get; set; }
+            // public string ServiceInfo1 { get; set; }
             /// <summary>
             /// 
             /// </summary>
-           // public string ServiceInfo2 { get; set; }
+            // public string ServiceInfo2 { get; set; }
             /// <summary>
             /// 
             /// </summary>
-           // public string AdditionalInfo { get; set; }
+            // public string AdditionalInfo { get; set; }
             /// <summary>
             /// 
             /// </summary>
-          //  public string Tags { get; set; }
+            //  public string Tags { get; set; }
             /// <summary>
             /// 
             /// </summary>
-         //   public string StoreServiceIdentifier { get; set; }
+            //   public string StoreServiceIdentifier { get; set; }
             /// <summary>
             /// 
             /// </summary>
-          //  public string DepartmentName { get; set; }
+            //  public string DepartmentName { get; set; }
             /// <summary>
             /// 
             /// </summary>
-           // public string CostCenter { get; set; }
+            // public string CostCenter { get; set; }
             /// <summary>
             /// 
             /// </summary>
@@ -1117,6 +1322,7 @@ namespace TEAMModelOS.Controllers
         /// </summary>
         public string client { get; set; }
         public string userId { get; set; }
+        public string scope { get; set; }
         public string tname { get; set; }
         public string school { get; set; }
         public string ip { get; set; }
@@ -1144,7 +1350,8 @@ namespace TEAMModelOS.Controllers
         public string name { get; set; }
         public string school { get; set; }
         public string p { get; set; }
-        public string ua { get; set; }
-        public string referer { get; set;  }
+        // public string ua { get; set; }
+        // public string referer { get; set;  }
+        public string scope { get; set; }
     }
 }

+ 6 - 5
TEAMModelOS/Filter/RequestAuditFilter.cs

@@ -15,6 +15,7 @@ using DocumentFormat.OpenXml.Office2016.Excel;
 using TEAMModelOS.SDK.DI;
 using Microsoft.Extensions.Primitives;
 using HTEXLib.Helpers.ShapeHelpers;
+using TEAMModelOS.Controllers;
 
 namespace TEAMModelOS.Filter
 {
@@ -124,9 +125,9 @@ namespace TEAMModelOS.Filter
             //同一个账号,同一IP,同一接口,UA标识(UA标识随意切换则表示可能会存在DDOS),时间段
             //_logger.LogInformation(new{ ua=httpContext.GetUserAgent(), ip=remoteIPv4,time=requestedTime,path =$"{httpRequest.PathBase}{httpRequest.Path}",host= $"{httpRequest.Host}", param=parameters,id ,name ,school,succeed =isRequestSucceed }.ToJsonString());
           
-            var data = new
+            var data = new  
             {
-                ua =ua,
+                //ua =ua,
                 ip = remoteIPv4,
                 time = requestedTime,
                 path = $"{httpRequest.PathBase}{httpRequest.Path}",
@@ -138,10 +139,10 @@ namespace TEAMModelOS.Filter
                 client = client,
                 tid = tokenSha,
                 scope = scope,
-                referer = refererUrl,
-                platform = secChUaPlatform,
+                // referer = refererUrl,
+                //platform = secChUaPlatform,
                 p = "os",
-                idToken=XAuthIdToken
+                //idToken=XAuthIdToken
             };
             _= _httpTrigger.RequestHttpTrigger(data, "China", "http-log");
 

+ 4 - 4
TEAMModelOS/TEAMModelOS.csproj

@@ -75,11 +75,11 @@
     <SpaRoot>ClientApp\</SpaRoot>
     <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
     <UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-    <Version>5.2403.6</Version>
-    <AssemblyVersion>5.2403.6.1</AssemblyVersion>
-    <FileVersion>5.2403.6.1</FileVersion>
+    <Version>5.2403.13</Version>
+    <AssemblyVersion>5.2403.13.1</AssemblyVersion>
+    <FileVersion>5.2403.13.1</FileVersion>
     <Description>TEAMModelOS(IES5)</Description>
-    <PackageReleaseNotes>IES版本说明版本切换标记5.2403.6.1</PackageReleaseNotes>
+    <PackageReleaseNotes>IES版本说明版本切换标记5.2403.13.1</PackageReleaseNotes>
     <PackageId>TEAMModelOS</PackageId>
     <Authors>teammodel</Authors>
     <Company>醍摩豆(成都)信息技术有限公司</Company>

+ 1 - 1
TEAMModelOS/appsettings.Development.json

@@ -18,7 +18,7 @@
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
     "HttpTrigger": "https://teammodelosfunction-test.chinacloudsites.cn/api/",
     //"HttpTrigger": "http://localhost:7071/api/"
-    "Version": "5.2403.6.1"
+    "Version": "5.2403.13.1"
   },
   "Azure": {
 

+ 1 - 1
TEAMModelOS/appsettings.json

@@ -18,7 +18,7 @@
     "Exp": 86400,
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
     "HttpTrigger": "https://teammodelosfunction.chinacloudsites.cn/api/",
-    "Version": "5.2403.6.1"
+    "Version": "5.2403.13.1"
   },
   "Azure": {
     "Storage": {