chore: 🔨 npm update

This commit is contained in:
tk 2025-01-14 15:31:16 +08:00 committed by nsnail
parent f50dfc8f19
commit 72cc3c42fd
5 changed files with 30 additions and 9 deletions

View File

@ -138,6 +138,8 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
{
var ret = includeFields!.ToDictionary(
x => x, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!.GetValue(entity));
// ReSharper disable once ConvertIfStatementToSwitchStatement
if (entity is IFieldModifiedUser) {
var userInfo = App.GetService<ContextUserInfo>();
if (userInfo == null) {
@ -148,6 +150,7 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
ret.Add(nameof(IFieldModifiedUser.ModifiedUserName), userInfo.UserName);
}
// ReSharper disable once SuspiciousTypeConversion.Global
if (entity is IFieldModifiedClientIp) {
ret.Add(nameof(IFieldModifiedClientIp.ModifiedClientIp), App.HttpContext?.GetRealIpAddress()?.MapToIPv4().ToString().IpV4ToInt32());
}

View File

@ -0,0 +1,16 @@
namespace NetAdmin.Host.Middlewares;
/// <summary>
/// 输出环境信息到 http header
/// </summary>
public sealed class EnvironmentInfoMiddleware(RequestDelegate next)
{
/// <summary>
/// 主函数
/// </summary>
public Task InvokeAsync(HttpContext context)
{
context.Response.Headers.Append("X-Node", Environment.MachineName);
return next(context);
}
}

View File

@ -37,12 +37,12 @@ public static class CaptchaImageHelper
await using var tranStream = resAsm.GetManifestResourceStream($"{tempPath}._{templateIndex}.transparent.png");
// 底图
using var backgroundImage = await Image.LoadAsync<Rgba32>(bgStream).ConfigureAwait(false);
using var backgroundImage = await Image.LoadAsync<Rgba32>(bgStream!).ConfigureAwait(false);
using var darkTemplateImage = await Image.LoadAsync<Rgba32>(darkStream).ConfigureAwait(false);
using var darkTemplateImage = await Image.LoadAsync<Rgba32>(darkStream!).ConfigureAwait(false);
// 透明模板图
using var transparentTemplateImage = await Image.LoadAsync<Rgba32>(tranStream).ConfigureAwait(false);
using var transparentTemplateImage = await Image.LoadAsync<Rgba32>(tranStream!).ConfigureAwait(false);
// 调整模板图大小
darkTemplateImage.Mutate(x => x.Resize(sliderSize));

View File

@ -49,8 +49,10 @@ public sealed class RedisLocker : IAsyncDisposable
return new RedisLocker(redisDatabase, lockerName);
}
if (retryCount > 1) {
await Task.Delay(retryDelay).ConfigureAwait(false);
}
}
throw new NetAdminGetLockerException(lockerName);
}

View File

@ -10,12 +10,12 @@
},
"dependencies": {
"@element-plus/icons-vue": "2.3.1",
"ace-builds": "1.37.1",
"aieditor": "1.3.3",
"ace-builds": "1.37.4",
"aieditor": "1.3.4",
"axios": "1.7.9",
"crypto-js": "4.2.0",
"echarts": "5.6.0",
"element-plus": "2.9.1",
"element-plus": "2.9.3",
"json-bigint": "1.0.0",
"markdown-it": "14.1.0",
"markdown-it-emoji": "3.0.0",
@ -34,9 +34,9 @@
"@vitejs/plugin-vue": "5.2.1",
"prettier": "3.4.2",
"prettier-plugin-organize-attributes": "1.0.0",
"sass": "1.83.0",
"sass": "1.83.1",
"terser": "5.37.0",
"vite": "6.0.6"
"vite": "6.0.7"
},
"browserslist": [
"> 1%",