🍒 fix(logging): 修复获取请求Ip为空的问题

This commit is contained in:
喵你个汪呀 2025-08-24 13:41:06 +08:00
parent f656c244a9
commit 03e40b8614

View File

@ -108,7 +108,7 @@ public class DatabaseLoggingWriter : IDatabaseLoggingWriter, IDisposable
var remoteIPv4 = reqHeaders.GetValueOrDefault("X-Forwarded-For")?.ToString();
// 获取IP地理位置
if (string.IsNullOrEmpty(remoteIPv4)) remoteIPv4 = reqHeaders.GetValueOrDefault("remoteIPv4")?.ToString();
if (string.IsNullOrEmpty(remoteIPv4)) remoteIPv4 = loggingMonitor.RemoteIPv4;
(string ipLocation, double? longitude, double? latitude) = CommonHelper.GetIpAddress(remoteIPv4);
// 获取设备信息