From df283c79bbb9ca118d1fa18d98464bfb62939496 Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Sun, 18 Sep 2022 15:44:46 +0800 Subject: [PATCH] Refactor this function to not always return the same value. --- .../app/routes/widgets/slidecontrol/slidecontrol.component.ts | 2 +- IoTSharp/Extensions/IoTSharpExtension.cs | 2 +- IoTSharp/appsettings.PostgreSql.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IoTSharp/ClientApp/src/app/routes/widgets/slidecontrol/slidecontrol.component.ts b/IoTSharp/ClientApp/src/app/routes/widgets/slidecontrol/slidecontrol.component.ts index 84793a2f1..850d5917f 100644 --- a/IoTSharp/ClientApp/src/app/routes/widgets/slidecontrol/slidecontrol.component.ts +++ b/IoTSharp/ClientApp/src/app/routes/widgets/slidecontrol/slidecontrol.component.ts @@ -130,7 +130,7 @@ export class SlidecontrolComponent implements OnInit { }, 1000); } ); - return false; + return true; } reset() { diff --git a/IoTSharp/Extensions/IoTSharpExtension.cs b/IoTSharp/Extensions/IoTSharpExtension.cs index f60fc161f..0542987e3 100644 --- a/IoTSharp/Extensions/IoTSharpExtension.cs +++ b/IoTSharp/Extensions/IoTSharpExtension.cs @@ -131,7 +131,7 @@ public static Guid GetUserId(this ClaimsPrincipal _user) /// public static Guid GetTenantId(this ClaimsPrincipal _user) { - return Guid.Parse( _user.FindFirstValue(IoTSharpClaimTypes.Tenant)); + return Guid.Parse( _user.FindFirstValue(IoTSharpClaimTypes.Tenant)??Guid.Empty.ToString()); } /// /// 获取当前用户的客户ID diff --git a/IoTSharp/appsettings.PostgreSql.json b/IoTSharp/appsettings.PostgreSql.json index 731435fc3..a1313beae 100644 --- a/IoTSharp/appsettings.PostgreSql.json +++ b/IoTSharp/appsettings.PostgreSql.json @@ -18,5 +18,5 @@ "EventBusStore": "InMemory", "EventBusMQ": "InMemory", "TelemetryStorage": "Sharding", - "EventBus": "Shashlik" + "-EventBus": "Shashlik" } \ No newline at end of file