abpvnext密码默认是强度密码,需要字母、特殊字符等组合,有时为了测试方便需要设置简单的密码,可如下设置,版本4.3,亲测好使。
/// <summary> /// 设置密码强度 /// </summary> /// <param name="context"></param> private void ConfigurePasswordSet(ServiceConfigurationContext context) { context.Services.Configure<IdentityOptions>(options => { options.User.RequireUniqueEmail = true; //options.Lockout.AllowedForNewUsers = true; //options.Lockout.MaxFailedAccessAttempts = 2; options.Password.RequireDigit = false; options.Password.RequireLowercase = false; options.Password.RequireNonAlphanumeric = false; options.Password.RequireUppercase = false; options.Password.RequiredLength = 6; }); }
abpvnext提供的webapi,在用vue前端调用时,有时需要DTO的属性是驼峰,可进行如下设置。
private static void ConfigureJson(ServiceConfigurationContext context) { //null: DTO的属性首字母保持大写 //JsonNamingPolicy.CamelCase; : DTO的属性首字母改为小写 context.Services.Configure<JsonOptions>(opt => { opt.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; }); }
运行效果图