diff --git a/FAuth/Controllers/api/UserController.cs b/FAuth/Controllers/api/UserController.cs index fab855f..25b95b9 100644 --- a/FAuth/Controllers/api/UserController.cs +++ b/FAuth/Controllers/api/UserController.cs @@ -58,6 +58,7 @@ namespace FAuth.Controllers.api fir.LastLoginDatetime = now; fir.Status |= FUserStatusEnum.Login; this.Db.SaveChangesAsync().Wait(); + this.Logger.LogInformation($"用户{userName}登录成功!"); return new CheckUserResult { Ticket = this.UserTicketDryptor.Encrypt(new UserTicketModel { Id = fir.Id, @@ -85,6 +86,7 @@ namespace FAuth.Controllers.api fir.Status &= ~FUserStatusEnum.Login; fir.LastLogoutDatetime = DateTimeOffset.Now; this.Db.SaveChangesAsync().Wait(); + this.Logger.LogInformation($"用户{userTicketModel.Id}:{userTicketModel.UserName}登出成功!"); return true; } @@ -135,6 +137,7 @@ namespace FAuth.Controllers.api item.Password = nPassword; } this.Db.SaveChangesAsync().Wait(); + this.Logger.LogInformation($"用户{userTicketModel.Id}:{userTicketModel.UserName}修改密码成功!"); return true; } @@ -167,6 +170,7 @@ namespace FAuth.Controllers.api }; this.Db.Entry(nUser).State = EntityState.Added; this.Db.SaveChangesAsync().Wait(); + this.Logger.LogInformation($"用户{nUser.Id}:{nUser.UserName}:{nUser.Name}添加成功!"); return true; } }