abp框架中IsSelfRegistrationEnabled在哪里设置?
Where is IsSelfRegistrationEnabled set in abp framework?
在ABP框架中,Login.cshtml页面有这一行:
@if (await SettingProvider.IsTrueAsync(AccountSettingNames.IsSelfRegistrationEnabled))
如何更改此设置?
谢谢
它在AccountSettingDefinitionProvider
帐户模块
中设置
..\abp\modules\account\src\Volo.Abp.Account.Application\Volo\Abp\Account\Settings\AccountSettingDefinitionProvider.cs
namespace Volo.Abp.Account.Settings
{
public class AccountSettingDefinitionProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(
AccountSettingNames.IsSelfRegistrationEnabled,
"true",
L("DisplayName:Abp.Account.IsSelfRegistrationEnabled"),
L("Description:Abp.Account.IsSelfRegistrationEnabled"), isVisibleToClients : true)
);
context.Add(
new SettingDefinition(
AccountSettingNames.EnableLocalLogin,
"true",
L("DisplayName:Abp.Account.EnableLocalLogin"),
L("Description:Abp.Account.EnableLocalLogin"), isVisibleToClients : true)
);
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<AccountResource>(name);
}
}
}
在身份服务器项目中,在文件 appsettings.json
中,将键 Abp.Account.IsSelfRegistrationEnabled
设置为值 false
。
{
"Settings":
{
"Abp.Account.IsSelfRegistrationEnabled": "false"
}
}
在ABP框架中,Login.cshtml页面有这一行:
@if (await SettingProvider.IsTrueAsync(AccountSettingNames.IsSelfRegistrationEnabled))
如何更改此设置?
谢谢
它在AccountSettingDefinitionProvider
帐户模块
..\abp\modules\account\src\Volo.Abp.Account.Application\Volo\Abp\Account\Settings\AccountSettingDefinitionProvider.cs
namespace Volo.Abp.Account.Settings
{
public class AccountSettingDefinitionProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(
AccountSettingNames.IsSelfRegistrationEnabled,
"true",
L("DisplayName:Abp.Account.IsSelfRegistrationEnabled"),
L("Description:Abp.Account.IsSelfRegistrationEnabled"), isVisibleToClients : true)
);
context.Add(
new SettingDefinition(
AccountSettingNames.EnableLocalLogin,
"true",
L("DisplayName:Abp.Account.EnableLocalLogin"),
L("Description:Abp.Account.EnableLocalLogin"), isVisibleToClients : true)
);
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<AccountResource>(name);
}
}
}
在身份服务器项目中,在文件 appsettings.json
中,将键 Abp.Account.IsSelfRegistrationEnabled
设置为值 false
。
{
"Settings":
{
"Abp.Account.IsSelfRegistrationEnabled": "false"
}
}