Przeglądaj źródła

优化登录人员记录信息

Li 3 lat temu
rodzic
commit
11434f91cc

+ 3 - 3
TEAMModelOS.FunctionV4/HttpTrigger/IESHttpTrigger.cs

@@ -215,7 +215,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                         {
                         {
                             Student student = await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReadItemAsync<Student>(id, new PartitionKey($"Base-{school}"));
                             Student student = await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReadItemAsync<Student>(id, new PartitionKey($"Base-{school}"));
                             student.loginInfos = new List<LoginInfo>() { new LoginInfo { expire = Expire, ip = ip, time = now } };
                             student.loginInfos = new List<LoginInfo>() { new LoginInfo { expire = Expire, ip = ip, time = now } };
-                            await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReplaceItemAsync<Student>(student, student.id, new PartitionKey("Base"));
+                            await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReplaceItemAsync<Student>(student, student.id, new PartitionKey($"Base-{school}"));
                         }
                         }
                         catch { }
                         catch { }
                         break;
                         break;
@@ -466,10 +466,10 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                     }
                     }
 
 
                     string tbScHourSql = $"PartitionKey eq 'HourLogin-{school}' and RowKey le '{delTbHour}'";
                     string tbScHourSql = $"PartitionKey eq 'HourLogin-{school}' and RowKey le '{delTbHour}'";
-                    await table.DeleteStringWhere<BIOptLog>(rowKey: tbHourSql); //删除学校168小时前的数据
+                    await table.DeleteStringWhere<BIOptLog>(rowKey: tbScHourSql); //删除学校168小时前的数据
 
 
                     string tbScDaySql = $"PartitionKey eq 'DayLogin-{school}' and RowKey le '{delTbDay}'";
                     string tbScDaySql = $"PartitionKey eq 'DayLogin-{school}' and RowKey le '{delTbDay}'";
-                    await table.DeleteStringWhere<BIOptLog>(rowKey: tbDaySql); //删除学校180天前的数据
+                    await table.DeleteStringWhere<BIOptLog>(rowKey: tbScDaySql); //删除学校180天前的数据
                 }
                 }
 
 
                 await response.WriteAsJsonAsync(new { data = json });
                 await response.WriteAsJsonAsync(new { data = json });