新增全局异常捕获

This commit is contained in:
南浔
2024-11-03 00:27:20 +08:00
28 changed files with 1030 additions and 86 deletions
+2 -1
View File
@@ -30,7 +30,7 @@ namespace Apimanager_backend.Models
/// <summary>
/// 用户角色
/// </summary>
public UserRole Role { get; set; } // Enum('Admin','User')
//public UserRole Role { get; set; } // Enum('Admin','User')
/// <summary>
/// 是否禁用
@@ -56,5 +56,6 @@ namespace Apimanager_backend.Models
public ICollection<OperationLog> operationLogs { get; set; }
public ICollection<ApiCallLog> CallLogs { get; set; }
public ICollection<Order> Orders { get; set; }
public ICollection<UserRole> Roles { get; set; } = new List<UserRole>();
}
}
+11 -4
View File
@@ -1,8 +1,15 @@
namespace Apimanager_backend.Models
using System.Text.Json.Serialization;
namespace Apimanager_backend.Models
{
public enum UserRole
public class UserRole
{
Admin = 0,
User = 1
public int Id { get; set; }
public int UserId { get; set; }
public string Role { get; set; }
//导航属性
[JsonIgnore]
public User User { get; set; }
}
}