feat: 增加模型约束条件
This commit is contained in:
parent
2eced5eadd
commit
55f673cacc
|
@ -47,6 +47,8 @@ namespace BootstrapAdmin.DataAccess.Models
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取/设置 密码
|
/// 获取/设置 密码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Display(Name = "密码")]
|
||||||
|
[Required(ErrorMessage = "{0}不可为空")]
|
||||||
public string? Password { get; set; }
|
public string? Password { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -87,6 +89,7 @@ namespace BootstrapAdmin.DataAccess.Models
|
||||||
/// 获得/设置 新密码
|
/// 获得/设置 新密码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "新密码")]
|
[Display(Name = "新密码")]
|
||||||
|
[Required(ErrorMessage = "{0}不可为空")]
|
||||||
[NotNull]
|
[NotNull]
|
||||||
public string? NewPassword { get; set; }
|
public string? NewPassword { get; set; }
|
||||||
|
|
||||||
|
@ -94,6 +97,8 @@ namespace BootstrapAdmin.DataAccess.Models
|
||||||
/// 获得/设置 新密码
|
/// 获得/设置 新密码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "确认密码")]
|
[Display(Name = "确认密码")]
|
||||||
|
[Required(ErrorMessage = "{0}不可为空")]
|
||||||
|
[Compare("NewPassword", ErrorMessage = "{0}与{1}不一致")]
|
||||||
[NotNull]
|
[NotNull]
|
||||||
public string? ConfirmPassword { get; set; }
|
public string? ConfirmPassword { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue