From 2b3937756521a1dab03f9dc99f16a6294ec925ef Mon Sep 17 00:00:00 2001 From: dev01 Date: Wed, 24 May 2023 17:31:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=89=8D=E5=8F=B0]=20=E5=BE=8C=E7=AB=AF=20?= =?UTF-8?q?=E9=83=A8=E5=88=86=20API=20=E8=AA=BF=E6=95=B4=20GUID=20->=20TAG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/DeviceManageController.cs | 2 +- FrontendWebApi/ApiControllers/HistoryController.cs | 2 +- FrontendWebApi/ApiControllers/LoginController.cs | 4 ++-- FrontendWebApi/Models/EmergencyDevice.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 8134147..284be73 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -716,7 +716,7 @@ namespace FrontendWebApi.ApiControllers join auth_page p on p.AuthCode = a.AuthCode where u.account = N'{role.Account}' and p.SubName = N'編輯設備名稱' - and p.building_guid = N'{role.Building_guid}'"; + and p.building_tag = N'{role.Building_tag}'"; var have = await backendRepository.GetOneAsync(sql); if (have == null) { diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index 67dfd5b..910271b 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -1156,7 +1156,7 @@ namespace FrontendWebApi.ApiControllers var device_item_info = device_item_infos.Where(x => x.Device_number == device_number && x.Points == point).FirstOrDefault(); var sql = $@"select '{device_item_info.Building_name}' as Building_name, '{device_item_info.Main_system_name}' as Main_system_name, - '{device_item_info.Sub_system_name}' as Sub_system_name', {device_item_info.Device_number}' as Device_number, + '{device_item_info.Sub_system_name}' as Sub_system_name, '{device_item_info.Device_number}' as Device_number, '{device_item_info.Device_name}' as Device_name, '{device_item_info.Item_name}' as Item_name, '{device_item_info.Points}' as Points, '{device_item_info.Unit}' as Unit, timestamp as Timestamp, round(value, 2) as Value from FIC_CENTER_{device_number}_{point} diff --git a/FrontendWebApi/ApiControllers/LoginController.cs b/FrontendWebApi/ApiControllers/LoginController.cs index 8042d9a..9834588 100644 --- a/FrontendWebApi/ApiControllers/LoginController.cs +++ b/FrontendWebApi/ApiControllers/LoginController.cs @@ -120,9 +120,9 @@ namespace FrontendWebApi.ApiControllers //取得當前登入使用者資訊 EDFunction edFunction = new EDFunction(); HttpContext.Session.SetString("MyApiAccount", edFunction.AESEncrypt(myUser.account)); //將帳號透過AES加密 - //} + // } - + apiResult.Data = myUser?.exp.ToString() + "_"+ HttpContext.Session.GetString("MyApiAccount") ?? null; apiResult.Code = "0000"; } catch (Exception exception) diff --git a/FrontendWebApi/Models/EmergencyDevice.cs b/FrontendWebApi/Models/EmergencyDevice.cs index 4f8eaec..9d72d50 100644 --- a/FrontendWebApi/Models/EmergencyDevice.cs +++ b/FrontendWebApi/Models/EmergencyDevice.cs @@ -212,7 +212,7 @@ namespace FrontendWebApi.Models public class ChangeNameRole { public string Account { get; set; } - public string Building_guid { get; set; } + public string Building_tag { get; set; } } public class SaveGrouping {