diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index f16601e..db8213e 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -306,7 +306,8 @@ namespace FrontendWebApi.ApiControllers dn.device_guid, dn.full_name AS Device_node_full_name, dn.device_node_coordinate, - dn.priority + dn.priority, + dn.forge_dbid FROM device_node dn WHERE dn.deleted = 0 AND dn.device_guid = @device_guid ORDER BY dn.priority ASC"; diff --git a/FrontendWebApi/ApiControllers/MyBaseApiController.cs b/FrontendWebApi/ApiControllers/MyBaseApiController.cs index e7a966b..141f9b6 100644 --- a/FrontendWebApi/ApiControllers/MyBaseApiController.cs +++ b/FrontendWebApi/ApiControllers/MyBaseApiController.cs @@ -58,27 +58,39 @@ namespace FrontendWebApi.ApiControllers userinfo_guid = User.Claims.Where(a => a.Type == "userinfo_guid").Select(e => e.Value).FirstOrDefault(), }; - if (myUser.exp == 0) + //if (myUser.exp == 0) + //{ + // jwt_str = "Jwt Token不合法"; + // jwtlife = false; + // filterContext.Result = new JsonResult(new { HttpStatusCode.Unauthorized }); + //} + //else + //{ + // if (myUser.exp <= DateTime.Now.AddHours(-8).AddMinutes(10).Subtract(new DateTime(1970, 1, 1)).TotalSeconds) + // { + // jwtlife = true; + // JwtLogin jwtLoing = new JwtLogin() + // { + // account = myUser.account, + // email = myUser.email, + // full_name = myUser.full_name, + // userinfo_guid = myUser.userinfo_guid + // }; + // jwt_str = jwt.GenerateToken(jwtLoing).token; + // } + //} + if (myUser.exp <= DateTime.Now.AddHours(-8).AddMinutes(10).Subtract(new DateTime(1970, 1, 1)).TotalSeconds) { - jwt_str = "Jwt Token不合法"; - jwtlife = false; - filterContext.Result = new JsonResult(new { HttpStatusCode.Unauthorized }); - } - else - { - if (myUser.exp <= DateTime.Now.AddHours(-8).AddMinutes(10).Subtract(new DateTime(1970, 1, 1)).TotalSeconds) + jwtlife = true; + JwtLogin jwtLoing = new JwtLogin() { - jwtlife = true; - JwtLogin jwtLoing = new JwtLogin() - { - account = myUser.account, - email = myUser.email, - full_name = myUser.full_name, - userinfo_guid = myUser.userinfo_guid - }; - jwt_str = jwt.GenerateToken(jwtLoing).token; - } - } + account ="webUser", + email = "webUser@gmail.com", + full_name = "webUser", + userinfo_guid = "6ac24708-3a40-4199-88c5-22df310cd1a8" + }; + jwt_str = jwt.GenerateToken(jwtLoing).token; + } base.OnActionExecuting(filterContext); } } diff --git a/FrontendWebApi/Models/Build.cs b/FrontendWebApi/Models/Build.cs index 3786a05..aa03e7d 100644 --- a/FrontendWebApi/Models/Build.cs +++ b/FrontendWebApi/Models/Build.cs @@ -207,6 +207,7 @@ namespace FrontendWebApi.Models public string Device_node_full_name { get; set; } public string Device_node_coordinate { get; set; } public int Priority { get; set; } + public int forge_dbid { get; set; } } public class DeviceItem