CrazyIter_Bin %!s(int64=2) %!d(string=hai) anos
pai
achega
b4af21a7fe

+ 4 - 0
TEAMModelOS.SDK/Models/Cosmos/School/School.cs

@@ -102,6 +102,10 @@ namespace TEAMModelOS.SDK.Models
         /// 是否為初始狀態
         /// </summary>
         public bool isinit { get; set; }
+        /// <summary>
+        /// 是否开启课例记录菜单
+        /// </summary>
+        public bool openLessonRecord { get; set; } = true;
     }
     /// <summary>
     /// 课表计划

+ 3 - 0
TEAMModelOS/Controllers/System/CoreController.cs

@@ -685,6 +685,9 @@ namespace TEAMModelOS.Controllers
             var version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
             long.TryParse(version.PadRight(12, '0').Replace(".", ""),out long aver);
             long.TryParse(_option.Version.PadRight(12, '0').Replace(".", ""),out long bver );
+            if (bver > aver) {
+                version = _option.Version;
+            }
             long nowtime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             //Console.WriteLine($"Assembly.GetEntryAssembly().GetName().Version: " +
 

+ 33 - 29
TEAMModelOS/Filter/AuthTokenAttribute.cs

@@ -103,46 +103,50 @@ namespace TEAMModelOS.Filter
                     }
                     string ip = IpPort.Split(":")[0];
                     var path = context.HttpContext.Request.Path;
-                    string key = $"IES5:BlackList:Token:{id}{school}{scope}:{ip}";
-                    var BTKExists = _azureRedis.GetRedisClient(8).KeyExists(key);
-                    if (BTKExists)
-                    { 
-                        var counts = _azureRedis.GetRedisClient(8).SortedSetScore(key, $"{path}");
-                        if (counts > 25)
+                    if (!$"{path}".Contains("used-space")) {
+                        string key = $"IES5:BlackList:Token:{id}{school}{scope}:{ip}";
+                        var BTKExists = _azureRedis.GetRedisClient(8).KeyExists(key);
+                        if (BTKExists)
                         {
-                            pass = false;
-                            var ttl = _azureRedis.GetRedisClient(8).KeyTimeToLive(key );
-                            if (ttl.Value.TotalSeconds > 11)
+                            var counts = _azureRedis.GetRedisClient(8).SortedSetScore(key, $"{path}");
+                            if (counts > 25)
+                            {
+                                pass = false;
+                                var ttl = _azureRedis.GetRedisClient(8).KeyTimeToLive(key);
+                                if (ttl.Value.TotalSeconds > 11)
+                                {
+                                    _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 0, 10));
+                                }
+                            }
+                            else
                             {
-                                _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 0, 10));
+                                _azureRedis.GetRedisClient(8).SortedSetIncrement(key, $"{path}", 1);
+                                _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 1, 0));
                             }
                         }
-                        else {
+                        else
+                        {
                             _azureRedis.GetRedisClient(8).SortedSetIncrement(key, $"{path}", 1);
                             _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 1, 0));
                         }
-                    }
-                    else
-                    {
-                        _azureRedis.GetRedisClient(8).SortedSetIncrement(key, $"{path}", 1);
-                        _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 1, 0));
-                    }
-                    //IP黑名单
-                    if (!string.IsNullOrWhiteSpace(ip)//&& !ip.Equals("127.0.0.1")
-                        )
-                    {
-                        var BIPExists = _azureRedis.GetRedisClient(8).HashExists("IES5:BlackList:IP", ip);
-                        if (BIPExists)
+                        //IP黑名单
+                        if (!string.IsNullOrWhiteSpace(ip)//&& !ip.Equals("127.0.0.1")
+                            )
+                        {
+                            var BIPExists = _azureRedis.GetRedisClient(8).HashExists("IES5:BlackList:IP", ip);
+                            if (BIPExists)
+                            {
+                                pass = false;
+                            }
+                        }
+                        //ID黑名单
+                        var BIDExists = _azureRedis.GetRedisClient(8).HashExists("IES5:BlackList:ID", id);
+                        if (BIDExists)
                         {
                             pass = false;
                         }
                     }
-                    //ID黑名单
-                    var BIDExists = _azureRedis.GetRedisClient(8).HashExists("IES5:BlackList:ID", id);
-                    if (BIDExists)
-                    {
-                        pass = false;
-                    }
+                   
                     if (pass)
                     {
                         context.HttpContext.Items.Add("ID", id);