.net Core下的 常用方法 获取IP地址 var feature = context.Features.Get<IHttpConnectionFeature>(); user.LastLoginIp = feature.RemoteIpAddress.ToString();