[FrontednWebApi] 可獲取 device_node 中的 forge_dbid 值
This commit is contained in:
		
							parent
							
								
									270e0855fc
								
							
						
					
					
						commit
						a17a11b180
					
				@ -306,7 +306,8 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                            dn.device_guid,
 | 
					                                            dn.device_guid,
 | 
				
			||||||
                                            dn.full_name AS Device_node_full_name,
 | 
					                                            dn.full_name AS Device_node_full_name,
 | 
				
			||||||
                                            dn.device_node_coordinate,
 | 
					                                            dn.device_node_coordinate,
 | 
				
			||||||
                                            dn.priority
 | 
					                                            dn.priority,
 | 
				
			||||||
 | 
								                                dn.forge_dbid
 | 
				
			||||||
                                        FROM device_node dn
 | 
					                                        FROM device_node dn
 | 
				
			||||||
                                        WHERE dn.deleted = 0 AND dn.device_guid = @device_guid
 | 
					                                        WHERE dn.deleted = 0 AND dn.device_guid = @device_guid
 | 
				
			||||||
                                        ORDER BY dn.priority ASC";
 | 
					                                        ORDER BY dn.priority ASC";
 | 
				
			||||||
 | 
				
			|||||||
@ -58,27 +58,39 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                userinfo_guid = User.Claims.Where(a => a.Type == "userinfo_guid").Select(e => e.Value).FirstOrDefault(),
 | 
					                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 = true;
 | 
				
			||||||
                jwtlife = false;
 | 
					                JwtLogin jwtLoing = new JwtLogin()
 | 
				
			||||||
                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;
 | 
					                    account ="webUser",
 | 
				
			||||||
                    JwtLogin jwtLoing = new JwtLogin()
 | 
					                    email = "webUser@gmail.com",
 | 
				
			||||||
                    {
 | 
					                    full_name = "webUser",
 | 
				
			||||||
                        account = myUser.account,
 | 
					                    userinfo_guid = "6ac24708-3a40-4199-88c5-22df310cd1a8"
 | 
				
			||||||
                        email = myUser.email,
 | 
					                };
 | 
				
			||||||
                        full_name = myUser.full_name,
 | 
					                jwt_str = jwt.GenerateToken(jwtLoing).token;
 | 
				
			||||||
                        userinfo_guid = myUser.userinfo_guid
 | 
					            } 
 | 
				
			||||||
                    };
 | 
					 | 
				
			||||||
                    jwt_str = jwt.GenerateToken(jwtLoing).token;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            base.OnActionExecuting(filterContext);
 | 
					            base.OnActionExecuting(filterContext);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -207,6 +207,7 @@ namespace FrontendWebApi.Models
 | 
				
			|||||||
        public string Device_node_full_name { get; set; }
 | 
					        public string Device_node_full_name { get; set; }
 | 
				
			||||||
        public string Device_node_coordinate { get; set; }
 | 
					        public string Device_node_coordinate { get; set; }
 | 
				
			||||||
        public int Priority { get; set; }
 | 
					        public int Priority { get; set; }
 | 
				
			||||||
 | 
					        public int forge_dbid { get; set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public class DeviceItem
 | 
					    public class DeviceItem
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user