From 5b4e01d943799539012260978cb73e5060faf9f2 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 15 May 2020 15:59:57 +0800 Subject: [PATCH] 1.0.0.5151 Former-commit-id: 3e0fd4796988e7e5a7b51e743b3d05b952aa2a6c --- projects/IoTNode/DeviceServices/FBee/FBeeService.cs | 4 ++++ projects/IoTNode/Startup.cs | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/projects/IoTNode/DeviceServices/FBee/FBeeService.cs b/projects/IoTNode/DeviceServices/FBee/FBeeService.cs index 562b2cba..384b8392 100644 --- a/projects/IoTNode/DeviceServices/FBee/FBeeService.cs +++ b/projects/IoTNode/DeviceServices/FBee/FBeeService.cs @@ -522,6 +522,10 @@ namespace IoTNode.DeviceServices.FBee deviceName = "三路开关"; deviceIcon = "switch3"; } + else + { + deviceName = null; + } } if (string.IsNullOrEmpty(deviceName)) { diff --git a/projects/IoTNode/Startup.cs b/projects/IoTNode/Startup.cs index a21c1508..53ce73cc 100644 --- a/projects/IoTNode/Startup.cs +++ b/projects/IoTNode/Startup.cs @@ -1,7 +1,9 @@ -using Hangfire; +using Application.Domain.Entities; +using Hangfire; using Hangfire.LiteDB; using Infrastructure.Data; using Infrastructure.Email; +using Infrastructure.Extensions; using Infrastructure.Web; using IoT.Shared.Services; using IoTNode.DeviceServices.FBee; @@ -10,9 +12,11 @@ using IoTNode.DeviceServices.SerialPortManager; using IoTNode.Services; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using System.Linq; namespace IoTNode { @@ -47,6 +51,12 @@ namespace IoTNode public override void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { base.Configure(app, env, loggerFactory); + using var scope = app.ApplicationServices.CreateScope(); + var services = scope.ServiceProvider; + var context = services.GetService(); + var node = context.Set().FirstOrDefault(); + node.Version = Helper.Instance.GetVersion(); + context.SaveChanges(); var options = new DashboardOptions {