Skip to content

Commit

Permalink
chore: 🔨 框架代码同步
Browse files Browse the repository at this point in the history
  • Loading branch information
tk authored and nsnail committed Dec 26, 2024
1 parent 7b8f1b0 commit b0a4f46
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,19 @@ private static Dictionary<string, object> IncludeToDictionary(TEntity entity, Li
{
var ret = includeFields!.ToDictionary(
x => x, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!.GetValue(entity));
if (entity is not IFieldModifiedUser) {
return ret;
}
if (entity is IFieldModifiedUser) {
var userInfo = App.GetService<ContextUserInfo>();
if (userInfo == null) {
return ret;
}

var userInfo = App.GetService<ContextUserInfo>();
if (userInfo == null) {
return ret;
ret.Add(nameof(IFieldModifiedUser.ModifiedUserId), userInfo.Id);
ret.Add(nameof(IFieldModifiedUser.ModifiedUserName), userInfo.UserName);
}

ret.Add(nameof(IFieldModifiedUser.ModifiedUserId), userInfo.Id);
ret.Add(nameof(IFieldModifiedUser.ModifiedUserName), userInfo.UserName);
if (entity is IFieldModifiedClientIp) {
ret.Add(nameof(IFieldModifiedClientIp.ModifiedClientIp), App.HttpContext?.GetRealIpAddress()?.MapToIPv4().ToString().IpV4ToInt32());
}

return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IFieldModifiedClientIp
/// <summary>
/// 客户端IP
/// </summary>
int ModifiedClientIp { get; init; }
int? ModifiedClientIp { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/>
<Import Project="$(SolutionDir)/build/prebuild.targets"/>
<ItemGroup>
<PackageReference Include="NetAdmin.FreeSql.DbContext" Version="1.0.7" Label="refs"/>
<PackageReference Include="NetAdmin.FreeSql.Provider.Sqlite" Version="1.0.7" Label="refs"/>
<PackageReference Include="Gurion" Version="1.2.6" Label="refs"/>
<PackageReference Include="NetAdmin.FreeSql.DbContext" Version="1.0.9" Label="refs"/>
<PackageReference Include="NetAdmin.FreeSql.Provider.Sqlite" Version="1.0.9" Label="refs"/>
<PackageReference Include="Gurion" Version="1.2.7" Label="refs"/>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0"/>
<PackageReference Include="Minio" Version="6.0.4"/>
<PackageReference Include="NSExt" Version="2.3.2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ private static void SetModificator(AuditValueEventArgs e, ContextUserInfo userIn

break;

case nameof(IFieldModifiedClientIp.ModifiedClientIp):
if (e.Value is null or 0) {
e.Value = App.HttpContext?.GetRealIpAddress()?.MapToIPv4().ToString().IpV4ToInt32();
}

break;
case nameof(IFieldModifiedUser.ModifiedUserName):
if (userInfo != null && e.Value is null or "") {
e.Value = userInfo.UserName;
Expand Down
29 changes: 0 additions & 29 deletions src/frontend/admin/src/assets/img/404.svg

This file was deleted.

57 changes: 0 additions & 57 deletions src/frontend/admin/src/assets/img/no-widgets.svg

This file was deleted.

Loading

0 comments on commit b0a4f46

Please sign in to comment.