feat: 日志管理独立出来、增加登录日志界面 (#65)

This commit is contained in:
2023-11-22 18:37:48 +08:00
committed by GitHub
parent 20195e7eaf
commit 9134c4fe01
15 changed files with 326 additions and 418 deletions

View File

@ -144,7 +144,7 @@ public sealed class DevService(IApiService apiService) : ServiceBase<DevService>
iconSelectContent = _regex2.Replace(iconSelectContent, "\"$1\":");
iconSelectContent = "{" + iconSelectContent + "}";
var iconExportJsInfo = iconSelectContent.ToObject<IconExportJsInfo>();
iconExportJsInfo.ExportDefault.Icons.Last().Icons.Add($"sc-icon-{req.IconName.ToLowerInvariant()}");
iconExportJsInfo.ExportDefault.Icons.Last().Icons.Add($"sc-icon-{req.IconName}");
var newContent = iconExportJsInfo.ToJson().TrimStart('{')[..^1].Replace("\"exportDefault\":", "export default");
await File.WriteAllTextAsync(iconSelectFile, newContent).ConfigureAwait(false);

View File

@ -28,7 +28,7 @@ public sealed class OperationLogger : IEventSubscriber
CreateRequestLogReq logReq = null;
// 登录日志特殊处理
if (operationEvent.Data.ApiId.Equals("api/user/login", StringComparison.OrdinalIgnoreCase)) {
if (operationEvent.Data.ApiId.Equals("api/sys/user/login.by.pwd", StringComparison.OrdinalIgnoreCase)) {
try {
var loginReq = operationEvent.Data.RequestBody.ToObject<LoginByPwdReq>();
logReq = operationEvent.Data with { ExtraData = loginReq.Account };