diff --git a/projects/Infrastructure/Views/Shared/_Layout.cshtml b/projects/Infrastructure/Views/Shared/_Layout.cshtml
index ad0ab408..aa22eb0d 100644
--- a/projects/Infrastructure/Views/Shared/_Layout.cshtml
+++ b/projects/Infrastructure/Views/Shared/_Layout.cshtml
@@ -28,10 +28,10 @@
@Html.AntiForgeryToken()
}
@@ -40,10 +40,10 @@
{
}
@@ -82,10 +82,10 @@
@Html.Raw(cfg["copyright"].Replace("{now}", DateTime.Now.Year.ToString()))
-
@Html.Raw(cfg["version"])
+
版本:@Html.Raw(cfg["version"]) 设备Id:@DeviceAttribute.DeviceId
@if (User.Identity.IsAuthenticated)
{
-
管理
+
管理
}
diff --git a/projects/Infrastructure/Web/DeviceAttribute.cs b/projects/Infrastructure/Web/DeviceAttribute.cs
index c90f5a01..1625836c 100644
--- a/projects/Infrastructure/Web/DeviceAttribute.cs
+++ b/projects/Infrastructure/Web/DeviceAttribute.cs
@@ -3,23 +3,22 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using System;
namespace Infrastructure.Web
{
public class DeviceAttribute : ActionFilterAttribute
{
- private static string _id;
+ public static string DeviceId { get; private set; }
static DeviceAttribute()
{
- _id = Helper.Instance.GetCPUNumber();
+ DeviceId = Helper.Instance.GetCPUNumber();
}
public override void OnResultExecuting(ResultExecutingContext context)
{
var config = context.HttpContext.RequestServices.GetService();
- if (config["id"] != _id.Md5().Base64UrlEncode().Md5())
+ if (config["id"] != DeviceId.Md5().Base64UrlEncode().Md5())
{
if (!context.HttpContext.Request.Path.Value.StartsWith("/App/"))
{
@@ -27,7 +26,7 @@ namespace Infrastructure.Web
}
else
{
- context.Result = new JsonResult($"设备{_id}的授权码\"{config["id"]}\"异常");
+ context.Result = new JsonResult($"设备{DeviceId}的授权码\"{config["id"]}\"异常");
}
}
}
diff --git a/projects/IoTCenter/IoTCenter.csproj b/projects/IoTCenter/IoTCenter.csproj
index 4a218311..2c73525a 100644
--- a/projects/IoTCenter/IoTCenter.csproj
+++ b/projects/IoTCenter/IoTCenter.csproj
@@ -12,6 +12,7 @@
+
\ No newline at end of file
diff --git a/publish/build.cmd b/publish/build.cmd
index 9fa55922..fe69ee6f 100644
--- a/publish/build.cmd
+++ b/publish/build.cmd
@@ -6,18 +6,16 @@ rd /q/s "./dist/"
echo d|xcopy "./src/linux-x64/publish" "./dist/linux-x64/publish" /s /e /y /f
echo d|xcopy "./src/linux-arm64/publish" "./dist/linux-arm64/publish" /s /e /y /f
-dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -r linux-x64 -o ../../publish/dist/linux-x64/publish/apps/UserCenter
-dotnet publish ../projects/IoTCenter/IoTCenter.csproj -c Release -r linux-x64 -o ../../publish/dist/linux-x64/publish/apps/IoTCenter
+dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -o ../../publish/dist/linux-x64/publish/apps/UserCenter
+dotnet publish ../projects/IoTCenter/IoTCenter.csproj -c Release -o ../../publish/dist/linux-x64/publish/apps/IoTCenter
-dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -r linux-arm64 -o ../../publish/dist/linux-arm64/publish/apps/UserCenter
-dotnet publish ../projects/IoTCenter/IoTCenter.csproj -c Release -r linux-arm64 -o ../../publish/dist/linux-arm64/publish/apps/IoTCenter
-dotnet publish ../projects/IoT/IoTNode/IoTNode.csproj -c Release -r linux-arm64 -o ../../../publish/dist/linux-arm64/publish/apps/IoTNode
+dotnet publish ../projects/IoT/IoTNode/IoTNode.csproj -c Release -o ../../../publish/dist/linux-arm64/publish/apps/IoTNode
dotnet publish ../projects/IoT/IoTServices/WinService/WinService.csproj -c Release -r win-x86 -o "../../../../publish/dist/win-x86/Program Files (x86)/WinService"
-dotnet publish ../projects/IoT/IoTServices/APService/APService.csproj -c Release -r linux-arm64 -o ../../../../publish/dist/linux-arm64/publish/apps/APService
-dotnet publish ../projects/IoT/IoTServices/ONVIFService/ONVIFService.csproj -c Release -r linux-x64 -o ../../../../publish/dist/linux-x64/publish/apps/ONVIFService
-dotnet publish ../projects/IoT/IoTServices/ONVIFService/ONVIFService.csproj -c Release -r linux-arm64 -o ../../../../publish/dist/linux-arm64/publish/apps/ONVIFService
-dotnet publish ../projects/IoT/IoTServices/SerialPortService/SerialPortService.csproj -c Release -r linux-arm64 -o ../../../../publish/dist/linux-arm64/publish/apps/SerialPortService
-dotnet publish ../projects/IoT/IoTServices/LiChuangService/LiChuangService.csproj -c Release -r linux-arm64 -o ../../../../publish/dist/linux-arm64/publish/apps/LiChuangService
+dotnet publish ../projects/IoT/IoTServices/APService/APService.csproj -c Release -o ../../../../publish/dist/linux-arm64/publish/apps/APService
+dotnet publish ../projects/IoT/IoTServices/ONVIFService/ONVIFService.csproj -c Release -o ../../../../publish/dist/linux-x64/publish/apps/ONVIFService
+dotnet publish ../projects/IoT/IoTServices/ONVIFService/ONVIFService.csproj -c Release -o ../../../../publish/dist/linux-arm64/publish/apps/ONVIFService
+dotnet publish ../projects/IoT/IoTServices/SerialPortService/SerialPortService.csproj -c Release -o ../../../../publish/dist/linux-arm64/publish/apps/SerialPortService
+dotnet publish ../projects/IoT/IoTServices/LiChuangService/LiChuangService.csproj -c Release -o ../../../../publish/dist/linux-arm64/publish/apps/LiChuangService
gradle build -p ../projects/IoT/IoTServices/NJWLService
set endtime=%time%
diff --git a/publish/build32.cmd b/publish/build32.cmd
deleted file mode 100644
index fe69ee6f..00000000
--- a/publish/build32.cmd
+++ /dev/null
@@ -1,22 +0,0 @@
-@echo off
-set startime=%time%
-
-rd /q/s "./dist/"
-
-echo d|xcopy "./src/linux-x64/publish" "./dist/linux-x64/publish" /s /e /y /f
-echo d|xcopy "./src/linux-arm64/publish" "./dist/linux-arm64/publish" /s /e /y /f
-
-dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -o ../../publish/dist/linux-x64/publish/apps/UserCenter
-dotnet publish ../projects/IoTCenter/IoTCenter.csproj -c Release -o ../../publish/dist/linux-x64/publish/apps/IoTCenter
-
-dotnet publish ../projects/IoT/IoTNode/IoTNode.csproj -c Release -o ../../../publish/dist/linux-arm64/publish/apps/IoTNode
-dotnet publish ../projects/IoT/IoTServices/WinService/WinService.csproj -c Release -r win-x86 -o "../../../../publish/dist/win-x86/Program Files (x86)/WinService"
-dotnet publish ../projects/IoT/IoTServices/APService/APService.csproj -c Release -o ../../../../publish/dist/linux-arm64/publish/apps/APService
-dotnet publish ../projects/IoT/IoTServices/ONVIFService/ONVIFService.csproj -c Release -o ../../../../publish/dist/linux-x64/publish/apps/ONVIFService
-dotnet publish ../projects/IoT/IoTServices/ONVIFService/ONVIFService.csproj -c Release -o ../../../../publish/dist/linux-arm64/publish/apps/ONVIFService
-dotnet publish ../projects/IoT/IoTServices/SerialPortService/SerialPortService.csproj -c Release -o ../../../../publish/dist/linux-arm64/publish/apps/SerialPortService
-dotnet publish ../projects/IoT/IoTServices/LiChuangService/LiChuangService.csproj -c Release -o ../../../../publish/dist/linux-arm64/publish/apps/LiChuangService
-gradle build -p ../projects/IoT/IoTServices/NJWLService
-
-set endtime=%time%
-echo %startime% %endtime%
\ No newline at end of file
diff --git a/publish/src/linux-arm64/publish/install.sh b/publish/src/linux-arm64/publish/install.sh
index 7bf9955e..b75b3996 100644
--- a/publish/src/linux-arm64/publish/install.sh
+++ b/publish/src/linux-arm64/publish/install.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+
#set root password
sudo passwd root<~/.config/autostart/chromium.desktop
echo '[Desktop Entry]'>>~/.config/autostart/chromium.desktop
-echo 'Exec=bash -c "chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=file:///home/pi/publish/apps/IoTNode/wwwroot/index.html"'>>~/.config/autostart/chromium.desktop
+#echo 'Exec=bash -c "chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=file:///home/pi/publish/apps/IoTNode/wwwroot/index.html"'>>~/.config/autostart/chromium.desktop
+echo 'Exec=bash -c "sleep 20&&chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=http://localhost:8002/index.html"'>>~/.config/autostart/chromium.desktop
#config apps
sudo cp -f ~/publish/supervisord.conf /etc/supervisor/supervisord.conf