diff --git a/Atomx.Admin/Atomx.Admin/Program.cs b/Atomx.Admin/Atomx.Admin/Program.cs
index ec6753a..1555ec9 100644
--- a/Atomx.Admin/Atomx.Admin/Program.cs
+++ b/Atomx.Admin/Atomx.Admin/Program.cs
@@ -27,6 +27,9 @@ var builder = WebApplication.CreateBuilder(args);
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(builder.Configuration)
.Enrich.FromLogContext()
+ .Enrich.WithProperty("Application", "Atomx.Admin")
+ .Enrich.WithProperty("Environment", builder.Environment.EnvironmentName)
+ .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}")
.CreateLogger();
// Add services to the container.
diff --git a/Atomx.Common/Entities/RefreshToken.cs b/Atomx.Common/Entities/RefreshToken.cs
new file mode 100644
index 0000000..a13f506
--- /dev/null
+++ b/Atomx.Common/Entities/RefreshToken.cs
@@ -0,0 +1,57 @@
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Atomx.Common.Entities
+{
+ ///
+ /// 刷新TOKEN
+ ///
+ [Table("RefreshTokens")]
+ public class RefreshToken
+ {
+ ///
+ /// 数据ID
+ ///
+ [DatabaseGenerated(DatabaseGeneratedOption.None)]
+ [Key]
+ public string Id { get; set; } = Guid.NewGuid().ToString();
+
+ ///
+ /// 用户ID
+ ///
+ public long UserId { get; set; }
+
+ ///
+ /// Token 信息
+ ///
+ [Column(TypeName = "varchar(500)")]
+ public string Token { get; set; } = string.Empty;
+
+ ///
+ /// 发布时间
+ ///
+ public DateTime IssuedTime { get; set; } = DateTime.UtcNow;
+
+ ///
+ /// 到期时间
+ ///
+ public DateTime ExpiresTime { get; set; }
+
+ ///
+ /// 是否回收
+ ///
+ public bool IsRevoked { get; set; }
+
+ ///
+ /// 用户IP
+ ///
+ [Column(TypeName = "varchar(50)")]
+ public string Ip { get; set; } = string.Empty;
+
+ ///
+ /// 用户系统代理信息
+ ///
+ [Column(TypeName = "varchar(500)")]
+ public string UserAgent { get; set; } = string.Empty;
+ }
+}
diff --git a/Atomx.Data/DataContext.cs b/Atomx.Data/DataContext.cs
index 1bc5fe2..5b31b7d 100644
--- a/Atomx.Data/DataContext.cs
+++ b/Atomx.Data/DataContext.cs
@@ -132,6 +132,11 @@ namespace Atomx.Data
///
public DbSet SpecificationAttributeOptions { get; set; }
+ ///
+ /// 刷新Tokens
+ ///
+ public DbSet RefreshTokens { get; set; }
+
///
/// 用户角色
///