diff --git a/assets/res/Fields.ln b/assets/res/Fields.ln
index 52e35857..b1a1b845 100644
--- a/assets/res/Fields.ln
+++ b/assets/res/Fields.ln
@@ -123,6 +123,7 @@
请求日志导出
调试
跟踪
+跟踪编号
身份证
运行
通知
diff --git a/build/code.quality.props b/build/code.quality.props
index 5e411972..dae8147d 100644
--- a/build/code.quality.props
+++ b/build/code.quality.props
@@ -15,7 +15,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/backend/NetAdmin.Domain/Attributes/IndicatorAttribute.cs b/src/backend/NetAdmin.Domain/Attributes/IndicatorAttribute.cs
index 2f3ff8ac..f489eb59 100644
--- a/src/backend/NetAdmin.Domain/Attributes/IndicatorAttribute.cs
+++ b/src/backend/NetAdmin.Domain/Attributes/IndicatorAttribute.cs
@@ -10,5 +10,5 @@ public sealed class IndicatorAttribute(string indicate) : Attribute
///
/// 状态指示
///
- public string Indicate { get; init; } = indicate;
+ public string Indicate { get; } = indicate;
}
\ No newline at end of file
diff --git a/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_Job.cs b/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_Job.cs
index 88455261..d3bfa988 100644
--- a/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_Job.cs
+++ b/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_Job.cs
@@ -61,7 +61,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
[Column]
[Ignore]
[JsonIgnore]
- public virtual HttpStatusCode? LastStatusCode { get; init; }
+ public HttpStatusCode? LastStatusCode { get; init; }
///
/// 下次执行时间
diff --git a/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_RequestLog.cs b/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_RequestLog.cs
index a572dac8..b700a58f 100644
--- a/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_RequestLog.cs
+++ b/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_RequestLog.cs
@@ -172,6 +172,14 @@ public record Sys_RequestLog : SimpleEntity, IFieldCreatedTime, IFieldCreatedCli
[JsonIgnore]
public virtual int? ServerIp { get; init; }
+ ///
+ /// 请求跟踪标识
+ ///
+ [Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
+ [Ignore]
+ [JsonIgnore]
+ public virtual string TraceId { get; init; }
+
///
/// 用户
///
diff --git a/src/backend/NetAdmin.Domain/Dto/Dependency/PagedQueryRsp.cs b/src/backend/NetAdmin.Domain/Dto/Dependency/PagedQueryRsp.cs
index b341b454..b94aeff0 100644
--- a/src/backend/NetAdmin.Domain/Dto/Dependency/PagedQueryRsp.cs
+++ b/src/backend/NetAdmin.Domain/Dto/Dependency/PagedQueryRsp.cs
@@ -6,17 +6,17 @@ namespace NetAdmin.Domain.Dto.Dependency;
public sealed record PagedQueryRsp(int Page, int PageSize, long Total, IEnumerable Rows) : IPagedInfo
where T : DataAbstraction
{
+ ///
+ /// 数据行
+ ///
+ public IEnumerable Rows { get; } = Rows;
+
///
public int Page { get; init; } = Page;
///
public int PageSize { get; init; } = PageSize;
- ///
- /// 数据行
- ///
- public IEnumerable Rows { get; init; } = Rows;
-
///
/// 数据总条
///
diff --git a/src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetAllEntriesRsp.cs b/src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetAllEntriesRsp.cs
index 5d6e3396..1716a4d2 100644
--- a/src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetAllEntriesRsp.cs
+++ b/src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetAllEntriesRsp.cs
@@ -34,6 +34,7 @@ public sealed record GetAllEntriesRsp : DataAbstraction
///
/// 绝对过期时间
///
+ [JsonInclude]
public long AbsExp { get; init; }
///
@@ -49,5 +50,6 @@ public sealed record GetAllEntriesRsp : DataAbstraction
///
/// 滑动过期时间
///
+ [JsonInclude]
public long SldExp { get; init; }
}
\ No newline at end of file
diff --git a/src/backend/NetAdmin.Domain/Dto/Sys/Dev/IconExportJsInfo.cs b/src/backend/NetAdmin.Domain/Dto/Sys/Dev/IconExportJsInfo.cs
index 820fb60e..870ed501 100644
--- a/src/backend/NetAdmin.Domain/Dto/Sys/Dev/IconExportJsInfo.cs
+++ b/src/backend/NetAdmin.Domain/Dto/Sys/Dev/IconExportJsInfo.cs
@@ -29,6 +29,7 @@ public sealed record IconExportJsInfo : DataAbstraction
///
/// Icons
///
+ [JsonInclude]
public ICollection Icons { get; init; }
///
diff --git a/src/backend/NetAdmin.Domain/Dto/Sys/Job/QueryJobRsp.cs b/src/backend/NetAdmin.Domain/Dto/Sys/Job/QueryJobRsp.cs
index 81e493fa..6846012d 100644
--- a/src/backend/NetAdmin.Domain/Dto/Sys/Job/QueryJobRsp.cs
+++ b/src/backend/NetAdmin.Domain/Dto/Sys/Job/QueryJobRsp.cs
@@ -10,6 +10,7 @@ namespace NetAdmin.Domain.Dto.Sys.Job;
public record QueryJobRsp : Sys_Job
{
///
+ [JsonInclude]
public new virtual string LastStatusCode =>
#pragma warning disable IDE0072
base.LastStatusCode switch {
diff --git a/src/backend/NetAdmin.Domain/Dto/Sys/JobRecord/QueryJobRecordRsp.cs b/src/backend/NetAdmin.Domain/Dto/Sys/JobRecord/QueryJobRecordRsp.cs
index 4c7b5366..da94da62 100644
--- a/src/backend/NetAdmin.Domain/Dto/Sys/JobRecord/QueryJobRecordRsp.cs
+++ b/src/backend/NetAdmin.Domain/Dto/Sys/JobRecord/QueryJobRecordRsp.cs
@@ -9,6 +9,7 @@ namespace NetAdmin.Domain.Dto.Sys.JobRecord;
public record QueryJobRecordRsp : Sys_JobRecord
{
///
+ [JsonInclude]
public new virtual string HttpStatusCode =>
base.HttpStatusCode == Numbers.HTTP_STATUS_BIZ_FAIL
? nameof(ErrorCodes.Unhandled).ToLowerCamelCase()
diff --git a/src/backend/NetAdmin.Domain/Dto/Sys/Menu/MetaInfo.cs b/src/backend/NetAdmin.Domain/Dto/Sys/Menu/MetaInfo.cs
index b213887f..4e288064 100644
--- a/src/backend/NetAdmin.Domain/Dto/Sys/Menu/MetaInfo.cs
+++ b/src/backend/NetAdmin.Domain/Dto/Sys/Menu/MetaInfo.cs
@@ -31,36 +31,43 @@ public sealed record MetaInfo : DataAbstraction
///
/// 背景颜色
///
+ [JsonInclude]
public string Color { get; init; }
///
/// 是否整页路由
///
+ [JsonInclude]
public bool FullPage { get; init; }
///
/// 是否隐藏
///
+ [JsonInclude]
public bool Hidden { get; init; }
///
/// 是否隐藏面包屑
///
+ [JsonInclude]
public bool HiddenBreadCrumb { get; init; }
///
/// 图标
///
+ [JsonInclude]
public string Icon { get; init; }
///
/// 标签
///
+ [JsonInclude]
public string Tag { get; init; }
///
/// 标题
///
+ [JsonInclude]
public string Title { get; init; }
///
@@ -68,5 +75,6 @@ public sealed record MetaInfo : DataAbstraction
///
[EnumDataType(typeof(MenuTypes), ErrorMessageResourceType = typeof(Ln)
, ErrorMessageResourceName = nameof(Ln.菜单类型不正确))]
+ [JsonInclude]
public MenuTypes Type { get; init; }
}
\ No newline at end of file
diff --git a/src/backend/NetAdmin.Domain/Dto/Sys/RequestLog/ExportRequestLogRsp.cs b/src/backend/NetAdmin.Domain/Dto/Sys/RequestLog/ExportRequestLogRsp.cs
index 65646bcb..c7dcfd7f 100644
--- a/src/backend/NetAdmin.Domain/Dto/Sys/RequestLog/ExportRequestLogRsp.cs
+++ b/src/backend/NetAdmin.Domain/Dto/Sys/RequestLog/ExportRequestLogRsp.cs
@@ -59,6 +59,12 @@ public record ExportRequestLogRsp : QueryRequestLogRsp
[Name(nameof(Ln.请求方式))]
public override string Method { get; init; }
+ ///
+ [CsvIndex(9)]
+ [Ignore(false)]
+ [Name(nameof(Ln.跟踪编号))]
+ public override string TraceId { get; init; }
+
///
[Ignore]
public override QueryUserRsp User { get; init; }
diff --git a/src/backend/NetAdmin.Domain/Dto/Sys/RequestLog/QueryRequestLogRsp.cs b/src/backend/NetAdmin.Domain/Dto/Sys/RequestLog/QueryRequestLogRsp.cs
index e9703a69..e112cc12 100644
--- a/src/backend/NetAdmin.Domain/Dto/Sys/RequestLog/QueryRequestLogRsp.cs
+++ b/src/backend/NetAdmin.Domain/Dto/Sys/RequestLog/QueryRequestLogRsp.cs
@@ -10,16 +10,19 @@ public record QueryRequestLogRsp : Sys_RequestLog, IRegister
///
/// 创建者客户端IP
///
+ [JsonInclude]
public new virtual string CreatedClientIp => base.CreatedClientIp?.ToIpV4();
///
/// 登录名
///
+ [JsonInclude]
public virtual string LoginName => RequestBody?.ToObject()?.Account;
///
/// 操作系统
///
+ [JsonInclude]
public virtual string Os => UserAgentParser.Create(CreatedUserAgent)?.Platform;
///
@@ -91,6 +94,10 @@ public record QueryRequestLogRsp : Sys_RequestLog, IRegister
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public override int? ServerIp { get; init; }
+ ///
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public override string TraceId { get; init; }
+
///
public new virtual QueryUserRsp User { get; init; }
diff --git a/src/backend/NetAdmin.Host/Extensions/IMvcBuilderExtensions.cs b/src/backend/NetAdmin.Host/Extensions/IMvcBuilderExtensions.cs
index a9e0c011..78c837f9 100644
--- a/src/backend/NetAdmin.Host/Extensions/IMvcBuilderExtensions.cs
+++ b/src/backend/NetAdmin.Host/Extensions/IMvcBuilderExtensions.cs
@@ -68,7 +68,7 @@ public static class IMvcBuilderExtensions
///
/// 设置Json选项
///
- public static void SetJsonOptions(bool enumToString, JsonOptions options)
+ private static void SetJsonOptions(bool enumToString, JsonOptions options)
{
////////////////////////////// json -> object
diff --git a/src/backend/NetAdmin.Host/Startup.cs b/src/backend/NetAdmin.Host/Startup.cs
index ce1c84d0..63946282 100644
--- a/src/backend/NetAdmin.Host/Startup.cs
+++ b/src/backend/NetAdmin.Host/Startup.cs
@@ -26,7 +26,7 @@ public abstract class Startup : AppStartup
///
/// 打印Banner
///
- protected static void ShowBanner()
+ private static void ShowBanner()
{
AnsiConsole.WriteLine();
var gridInfo = new Grid().AddColumn(new GridColumn().NoWrap().Width(50).PadRight(10))
diff --git a/src/backend/NetAdmin.Host/Utils/RequestLogger.cs b/src/backend/NetAdmin.Host/Utils/RequestLogger.cs
index 80ce721c..75f7d039 100644
--- a/src/backend/NetAdmin.Host/Utils/RequestLogger.cs
+++ b/src/backend/NetAdmin.Host/Utils/RequestLogger.cs
@@ -19,7 +19,6 @@ public sealed class RequestLogger(ILogger logger, IEventPublisher
{
// 从请求头中读取用户信息
var associatedUser = GetAssociatedUser(context);
-
var auditData = new CreateRequestLogReq {
Duration = duration
, Method = context.Request.Method
@@ -48,6 +47,7 @@ public sealed class RequestLogger(ILogger logger, IEventPublisher
?.MapToIPv4()
.ToString()
.IpV4ToInt32()
+ , TraceId = context.TraceIdentifier
};
// 打印日志
diff --git a/src/backend/NetAdmin.Infrastructure/Exceptions/NetAdminException.cs b/src/backend/NetAdmin.Infrastructure/Exceptions/NetAdminException.cs
index ed254852..230e8906 100644
--- a/src/backend/NetAdmin.Infrastructure/Exceptions/NetAdminException.cs
+++ b/src/backend/NetAdmin.Infrastructure/Exceptions/NetAdminException.cs
@@ -19,5 +19,5 @@ public abstract class NetAdminException(string message, Exception innerException
///
/// 错误码
///
- public ErrorCodes Code { get; init; }
+ public ErrorCodes Code { get; }
}
\ No newline at end of file
diff --git a/src/backend/NetAdmin.Infrastructure/Extensions/HttpRequestMessageExtensions.cs b/src/backend/NetAdmin.Infrastructure/Extensions/HttpRequestMessageExtensions.cs
index 34306ad1..0158b75d 100644
--- a/src/backend/NetAdmin.Infrastructure/Extensions/HttpRequestMessageExtensions.cs
+++ b/src/backend/NetAdmin.Infrastructure/Extensions/HttpRequestMessageExtensions.cs
@@ -5,22 +5,22 @@ namespace NetAdmin.Infrastructure.Extensions;
///
public static class HttpRequestMessageExtensions
{
- ///
- /// 将Http请求的Uri、Header、Body打包成Json字符串
- ///
- public static async Task BuildJsonAsync(this HttpRequestMessage me)
- {
- var body = me?.Content == null ? null : await me.Content!.ReadAsStringAsync().ConfigureAwait(false);
- return new { Uri = me?.RequestUri, Header = me?.ToString(), Body = body }.ToJson();
- }
-
///
/// 记录日志
///
public static async Task LogAsync(this HttpRequestMessage me, ILogger logger)
{
logger.Info(
- $"HTTP Request: {(await me.BuildJsonAsync().ConfigureAwait(false))?.Sub(0, Numbers.MAX_LIMIT_PRINT_LEN_CONTENT)}");
+ $"HTTP Request {(await me.BuildJsonAsync().ConfigureAwait(false))?.Sub(0, Numbers.MAX_LIMIT_PRINT_LEN_CONTENT)}");
return me;
}
+
+ ///
+ /// 将Http请求的Uri、Header、Body打包成Json字符串
+ ///
+ private static async Task BuildJsonAsync(this HttpRequestMessage me)
+ {
+ var body = me?.Content == null ? null : await me.Content!.ReadAsStringAsync().ConfigureAwait(false);
+ return new { Uri = me?.RequestUri, Header = me?.ToString(), Body = body }.ToJson();
+ }
}
\ No newline at end of file
diff --git a/src/backend/NetAdmin.Infrastructure/Extensions/HttpResponseMessageExtensions.cs b/src/backend/NetAdmin.Infrastructure/Extensions/HttpResponseMessageExtensions.cs
index a03650e2..cacbf0bc 100644
--- a/src/backend/NetAdmin.Infrastructure/Extensions/HttpResponseMessageExtensions.cs
+++ b/src/backend/NetAdmin.Infrastructure/Extensions/HttpResponseMessageExtensions.cs
@@ -11,9 +11,8 @@ public static class HttpResponseMessageExtensions
public static async Task LogAsync(this HttpResponseMessage me, ILogger logger
, Func bodyPreHandle = null)
{
- logger.Info(
- (await me.BuildJsonAsync(bodyPreHandle).ConfigureAwait(false))?.Sub(
- 0, Numbers.MAX_LIMIT_PRINT_LEN_CONTENT));
+ logger.Info($"HTTP Response {(await me.BuildJsonAsync(bodyPreHandle).ConfigureAwait(false))?.Sub(
+ 0, Numbers.MAX_LIMIT_PRINT_LEN_CONTENT)}");
}
///
diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/Dependency/IDicContentService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/Dependency/IDicContentService.cs
index a4e9a902..98965c8f 100644
--- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/Dependency/IDicContentService.cs
+++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/Dependency/IDicContentService.cs
@@ -13,4 +13,9 @@ public interface IDicContentService : IService, IDicContentModule
/// 编辑字典内容
///
Task EditAsync(EditDicContentReq req);
+
+ ///
+ /// 通过分类键查询字典内容
+ ///
+ Task> QueryByCatalogCodeAsync(string catalogCode);
}
\ No newline at end of file
diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicContentService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicContentService.cs
index 805f4c33..3400386d 100644
--- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicContentService.cs
+++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicContentService.cs
@@ -141,6 +141,17 @@ public sealed class DicContentService(BasicRepository rpo)
return ret.Adapt>();
}
+ ///
+ public async Task> QueryByCatalogCodeAsync(string catalogCode)
+ {
+ var ret = await Rpo.Orm.Select()
+ .Include(a => a.Catalog)
+ .Where(a => a.Catalog.Code == catalogCode)
+ .ToListAsync()
+ .ConfigureAwait(false);
+ return ret.Adapt>();
+ }
+
private ISelect QueryInternal(QueryReq req)
{
var ret = Rpo.Select.WhereDynamicFilter(req.DynamicFilter).WhereDynamic(req.Filter);
diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs
index 75bf6258..5201054b 100644
--- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs
+++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs
@@ -279,17 +279,16 @@ public sealed class UserService(
public async Task ResetPasswordAsync(ResetPasswordReq req)
{
req.ThrowIfInvalid();
- if (await verifyCodeService.VerifyAsync(req.VerifySmsCodeReq).ConfigureAwait(false)) {
- var dto = (await Rpo.Where(a => a.Mobile == req.VerifySmsCodeReq.DestDevice)
- .ToOneAsync(a => new { a.Version, a.Id })
- .ConfigureAwait(false)).Adapt() with {
- Password = req.PasswordText.Pwd()
- .Guid()
- };
- return await UpdateAsync(dto, [nameof(Sys_User.Password)]).ConfigureAwait(false);
+ if (!await verifyCodeService.VerifyAsync(req.VerifySmsCodeReq).ConfigureAwait(false)) {
+ throw new NetAdminInvalidOperationException(Ln.验证码不正确);
}
- throw new NetAdminInvalidOperationException(Ln.验证码不正确);
+ var dto = (await Rpo.Where(a => a.Mobile == req.VerifySmsCodeReq.DestDevice)
+ .ToOneAsync(a => new { a.Version, a.Id })
+ .ConfigureAwait(false)).Adapt() with {
+ Password = req.PasswordText.Pwd().Guid()
+ };
+ return await UpdateAsync(dto, [nameof(Sys_User.Password)]).ConfigureAwait(false);
}
///
diff --git a/src/backend/NetAdmin.SysComponent.Cache/Sys/Dependency/IDicContentCache.cs b/src/backend/NetAdmin.SysComponent.Cache/Sys/Dependency/IDicContentCache.cs
index a3a1e214..8e21721e 100644
--- a/src/backend/NetAdmin.SysComponent.Cache/Sys/Dependency/IDicContentCache.cs
+++ b/src/backend/NetAdmin.SysComponent.Cache/Sys/Dependency/IDicContentCache.cs
@@ -1,4 +1,5 @@
using NetAdmin.Cache;
+using NetAdmin.Domain.Dto.Sys.Dic.Content;
using NetAdmin.SysComponent.Application.Modules.Sys;
using NetAdmin.SysComponent.Application.Services.Sys.Dependency;
@@ -7,4 +8,10 @@ namespace NetAdmin.SysComponent.Cache.Sys.Dependency;
///
/// 字典内容缓存
///
-public interface IDicContentCache : ICache, IDicContentModule;
\ No newline at end of file
+public interface IDicContentCache : ICache, IDicContentModule
+{
+ ///
+ /// 通过分类键查询字典内容
+ ///
+ Task> QueryByCatalogCodeAsync(string catalogCode);
+}
\ No newline at end of file
diff --git a/src/backend/NetAdmin.SysComponent.Cache/Sys/Dependency/IUserCache.cs b/src/backend/NetAdmin.SysComponent.Cache/Sys/Dependency/IUserCache.cs
index 5821ca05..8c3261a4 100644
--- a/src/backend/NetAdmin.SysComponent.Cache/Sys/Dependency/IUserCache.cs
+++ b/src/backend/NetAdmin.SysComponent.Cache/Sys/Dependency/IUserCache.cs
@@ -1,7 +1,4 @@
using NetAdmin.Cache;
-using NetAdmin.Domain.Dto.Dependency;
-using NetAdmin.Domain.Dto.Sys.User;
-using NetAdmin.Domain.Dto.Sys.UserProfile;
using NetAdmin.SysComponent.Application.Modules.Sys;
using NetAdmin.SysComponent.Application.Services.Sys.Dependency;
@@ -12,41 +9,6 @@ namespace NetAdmin.SysComponent.Cache.Sys.Dependency;
///
public interface IUserCache : ICache, IUserModule
{
- ///
- /// 删除缓存 CheckMobileAvailableAsync
- ///
- Task RemoveCheckMobileAvailableAsync(CheckMobileAvailableReq req);
-
- ///
- /// 删除缓存 CheckUserNameAvailableAsync
- ///
- Task RemoveCheckUserNameAvailableAsync(CheckUserNameAvailableReq req);
-
- ///
- /// 删除缓存 LoginByPwdAsync
- ///
- Task RemoveLoginByPwdAsync(LoginByPwdReq req);
-
- ///
- /// 删除缓存 LoginBySmsAsync
- ///
- Task RemoveLoginBySmsAsync(LoginBySmsReq req);
-
- ///
- /// 删除缓存 QueryProfileAsync
- ///
- Task RemoveQueryProfileAsync(QueryReq req);
-
- ///
- /// 删除缓存 RegisterAsync
- ///
- Task RemoveRegisterAsync(RegisterUserReq req);
-
- ///
- /// 删除缓存 ResetPasswordAsync
- ///
- Task RemoveResetPasswordAsync(ResetPasswordReq req);
-
///
/// 删除缓存 UserInfoAsync
///
diff --git a/src/backend/NetAdmin.SysComponent.Cache/Sys/DicContentCache.cs b/src/backend/NetAdmin.SysComponent.Cache/Sys/DicContentCache.cs
index bd92d993..9ae6a536 100644
--- a/src/backend/NetAdmin.SysComponent.Cache/Sys/DicContentCache.cs
+++ b/src/backend/NetAdmin.SysComponent.Cache/Sys/DicContentCache.cs
@@ -63,4 +63,16 @@ public sealed class DicContentCache(IDistributedCache cache, IDicContentService
{
return Service.QueryAsync(req);
}
+
+ ///
+ public Task> QueryByCatalogCodeAsync(string catalogCode)
+ {
+ #if !DEBUG
+ return GetOrCreateAsync( //
+ GetCacheKey(catalogCode), () => Service.QueryByCatalogCodeAsync(catalogCode)
+, TimeSpan.FromSeconds(Numbers.SECS_CACHE_DIC_CATALOG_CODE));
+ #else
+ return Service.QueryByCatalogCodeAsync(catalogCode);
+ #endif
+ }
}
\ No newline at end of file
diff --git a/src/backend/NetAdmin.SysComponent.Cache/Sys/UserCache.cs b/src/backend/NetAdmin.SysComponent.Cache/Sys/UserCache.cs
index 4301754c..5bef4bfd 100644
--- a/src/backend/NetAdmin.SysComponent.Cache/Sys/UserCache.cs
+++ b/src/backend/NetAdmin.SysComponent.Cache/Sys/UserCache.cs
@@ -119,48 +119,6 @@ public sealed class UserCache(IDistributedCache cache, IUserService service, IVe
return Service.RegisterAsync(req);
}
- ///
- public Task RemoveCheckMobileAvailableAsync(CheckMobileAvailableReq req)
- {
- throw new NotImplementedException();
- }
-
- ///
- public Task RemoveCheckUserNameAvailableAsync(CheckUserNameAvailableReq req)
- {
- throw new NotImplementedException();
- }
-
- ///
- public Task RemoveLoginByPwdAsync(LoginByPwdReq req)
- {
- throw new NotImplementedException();
- }
-
- ///
- public Task RemoveLoginBySmsAsync(LoginBySmsReq req)
- {
- throw new NotImplementedException();
- }
-
- ///
- public Task RemoveQueryProfileAsync(QueryReq req)
- {
- throw new NotImplementedException();
- }
-
- ///
- public Task RemoveRegisterAsync(RegisterUserReq req)
- {
- throw new NotImplementedException();
- }
-
- ///
- public Task RemoveResetPasswordAsync(ResetPasswordReq req)
- {
- throw new NotImplementedException();
- }
-
///
public Task RemoveUserInfoAsync()
{
diff --git a/src/frontend/admin/src/components/naDicCatalog/index.vue b/src/frontend/admin/src/components/naDicCatalog/index.vue
index 048a47f0..44ea39cf 100644
--- a/src/frontend/admin/src/components/naDicCatalog/index.vue
+++ b/src/frontend/admin/src/components/naDicCatalog/index.vue
@@ -1,5 +1,6 @@
-
+
{{ item }}
diff --git a/src/frontend/admin/src/style/app.scss b/src/frontend/admin/src/style/app.scss
index 90dff400..7e474928 100644
--- a/src/frontend/admin/src/style/app.scss
+++ b/src/frontend/admin/src/style/app.scss
@@ -497,6 +497,10 @@ textarea {
margin-top: 2rem;
}
+.mb-8 {
+ margin-bottom: 2rem;
+}
+
.w100p {
width: 100%;
}
diff --git a/src/frontend/admin/src/style/media.scss b/src/frontend/admin/src/style/media.scss
index 2d7f4ff2..82ecbcbf 100644
--- a/src/frontend/admin/src/style/media.scss
+++ b/src/frontend/admin/src/style/media.scss
@@ -121,13 +121,13 @@
margin-top: 1rem;
border-bottom: 1px solid var(--el-border-color-light);
}
- .adminui-main > .el-container > .el-container > .el-header {
+ .adminui-main > .el-container .el-header {
@extend .headerPublic;
}
- .adminui-main > .el-container > .el-container > .el-header .left-panel {
+ .adminui-main > .el-container .el-header .left-panel {
display: block;
}
- .adminui-main > .el-container > .el-container > .el-header .right-panel {
+ .adminui-main > .el-container .el-header .right-panel {
display: block;
margin-top: 1rem;
}
diff --git a/src/frontend/admin/src/utils/tool.js b/src/frontend/admin/src/utils/tool.js
index 4fd687ad..4cd58527 100644
--- a/src/frontend/admin/src/utils/tool.js
+++ b/src/frontend/admin/src/utils/tool.js
@@ -247,6 +247,10 @@ tool.groupSeparator = function (num) {
})
.replace(/\.$/, '')
}
+// unicode解码
+tool.unicodeDecode = function (str) {
+ return str.replace(/\\u([0-9a-fA-F]{4})/g, (match, grp) => String.fromCharCode(parseInt(grp, 16)))
+}
// 属性排序
tool.sortProperties = function (obj) {
const sortedKeys = Object.keys(obj).sort()
diff --git a/src/frontend/admin/src/views/sys/dic/index.vue b/src/frontend/admin/src/views/sys/dic/index.vue
index 490614d3..c82f09cd 100644
--- a/src/frontend/admin/src/views/sys/dic/index.vue
+++ b/src/frontend/admin/src/views/sys/dic/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -23,6 +23,7 @@
{{ data.name }} {{ data.code }}
+
@@ -36,7 +37,9 @@
- {{ $t('字典分类') }}
+ {{
+ $t('字典分类')
+ }}
@@ -105,8 +108,8 @@ export default {
return targetText.indexOf(value) !== -1
},
//字典目录增加
- async add() {
- this.dialog.save = { mode: 'add' }
+ async add(id, code) {
+ this.dialog.save = { mode: 'add', data: { catalogId: id, code: code + '>' } }
},
//字典目录编辑
async edit(data) {
diff --git a/src/frontend/admin/src/views/sys/dic/list/index.vue b/src/frontend/admin/src/views/sys/dic/list/index.vue
index 4939163e..a17ff6f3 100644
--- a/src/frontend/admin/src/views/sys/dic/list/index.vue
+++ b/src/frontend/admin/src/views/sys/dic/list/index.vue
@@ -16,7 +16,10 @@
ref="search" />
-
+
diff --git a/src/frontend/admin/src/views/sys/dic/list/save.vue b/src/frontend/admin/src/views/sys/dic/list/save.vue
index 12697e4e..954d4f99 100644
--- a/src/frontend/admin/src/views/sys/dic/list/save.vue
+++ b/src/frontend/admin/src/views/sys/dic/list/save.vue
@@ -5,7 +5,7 @@
-
+
@@ -63,6 +63,7 @@ export default {
this.visible = true
this.loading = true
this.mode = data.mode
+ this.form.catalogId = data.data?.catalogId
if (data.row?.id) {
const res = await this.$API.sys_dic.getContent.post({ id: data.row.id })
Object.assign(this.form, res.data)
diff --git a/src/frontend/admin/src/views/sys/dic/save.vue b/src/frontend/admin/src/views/sys/dic/save.vue
index 530d466e..88f31ecc 100644
--- a/src/frontend/admin/src/views/sys/dic/save.vue
+++ b/src/frontend/admin/src/views/sys/dic/save.vue
@@ -8,7 +8,7 @@
-
+
@@ -45,6 +45,8 @@ export default {
this.visible = true
this.loading = true
this.mode = data.mode
+ this.form.parentId = data.data?.catalogId
+ this.form.code = data.data?.code
if (data.row?.id) {
const res = await this.$API.sys_dic.getCatalog.post({ id: data.row.id })
Object.assign(this.form, res.data)
diff --git a/src/frontend/admin/src/views/sys/job/index.vue b/src/frontend/admin/src/views/sys/job/index.vue
index c621b91d..f74ffff6 100644
--- a/src/frontend/admin/src/views/sys/job/index.vue
+++ b/src/frontend/admin/src/views/sys/job/index.vue
@@ -1,9 +1,15 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+