我正在使用Asp.Net-Identity-2,我正在尝试使用以下方法验证电子邮件验证码.但我收到"无效令牌"错误消息.
我的应用程序的用户管理器是这样的:
public class AppUserManager : UserManager<AppUser>
{
public AppUserManager(IUserStore<AppUser> store) : base(store) { }
public static AppUserManager Create(IdentityFactoryOptions<AppUserManager> options, IOwinContext context)
{
AppIdentityDbContext db = context.Get<AppIdentityDbContext>();
AppUserManager manager = new AppUserManager(new UserStore<AppUser>(db));
manager.PasswordValidator = new PasswordValidator {
RequiredLength = 6,
RequireNonLetterOrDigit = false,
RequireDigit = false,
RequireLowercase = true,
RequireUppercase = true
};
manager.UserValidator = new UserValidator<AppUser>(manager)
{
AllowOnlyAlphanumericUserNames = true,
RequireUniqueEmail = true
};
var dataProtectionProvider = options.DataProtectionProvider;
//token life span is 3 hours …
Run Code Online (Sandbox Code Playgroud)使用 bootstrap 4,我设置了一个简单的是/否自定义单选按钮。
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="rd_1" name="rd" class="custom-control-input green" value="Yes">
<label class="custom-control-label" for="rd_1">Yes</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="rd_2" name="rd" class="custom-control-input red" value="No">
<label class="custom-control-label" for="rd_2">No</label>
</div>
Run Code Online (Sandbox Code Playgroud)
当用户选择“是”时,我希望“是”按钮的颜色变为绿色,当用户选择“否”时,“否”按钮的颜色变为红色。
我可以使用下面的 css 定义两个收音机的颜色,但是如何为每个收音机定义不同的颜色?
.custom-control-input:checked ~ .custom-control-label::before {
color: #fff;
border-color: #7B1FA2;
background-color: red;
}
Run Code Online (Sandbox Code Playgroud)