获取IP地址
var feature = context.Features.Get<IHttpConnectionFeature>();
user.LastLoginIp = feature.RemoteIpAddress.ToString();
获取IP地址
var feature = context.Features.Get<IHttpConnectionFeature>();
user.LastLoginIp = feature.RemoteIpAddress.ToString();
转载于:https://www.cnblogs.com/zkcloud/p/5572700.html