你好,我目前尝试设置一个带有一些默认设置的ABP项目。我希望启用默认的聊天模块。我现在试过的..。
在FeatureConfigurator中启用它
public static class PortalGlobalFeatureConfigurator
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
GlobalFeatureManager.Instance.Modules.CmsKit(x => x.EnableAll());
GlobalFeatureManager.Instance.Modules.CmsKitPro(x => x.EnableAll());
GlobalFeatureManager.Instance.Modules.FeatureManager.Enable<ChatFeatures>();
GlobalFeatureManager.Instance.Modules.FeatureManager.Enable<LanguageManagementFeatures>();
});
}
}但是,当我开始迁移时,我会得到以下异常:
define the Volo.Abp.GlobalFeatures.GlobalFeatureNameAttribute atttribute!在DataSeed中启用它
_featureManager.SetForTenantAsync(tenantId, FeatureNameConstants.Chat, "True");但是,当我开始迁移时,我会得到以下异常
The Chat Module is not Enabled在没有UI交互的情况下,如何在第一次迁移中启用特性?
发布于 2022-06-07 08:09:52
最后,我想出了如何启用默认特性。也许这能帮到别人..。
如上面所示,只对CMS特性使用GlobalFeatureManager。例如,在FeatureManager类中注入SaasDataSeedContributer
string feature = "Chat.Enable"
// For the null tenant
await _featureManager.SetAsync(feature, "True", "T", null);
// For every other tenant
await _featureManager.SetForTenantAsync(tenant.Id, feature, "True", true);https://stackoverflow.com/questions/72460040
复制相似问题