Activities of "liangshiwei"

Hi,

Your event handler can implement theIAuditingEnabled interface to enable the audit logging for that class by default.

public class MyHandler : IDistributedEventHandler, IAuditingEnabled
{
    
    // add virtual keyword
    public virtual async ..... HandleEventAsync(xxx)
    {
    
    }
}

Hi,

The Get source command is used to download module source code.

what's your email, i can share the @volo/abp.commercial.ng.ui source code with you.

Hi,

could you please share the error logs?

Hi,

Your code looks like no problem, will it work if you upload a file?

Answer

Hi,

Sorry, I didn't get it. Do you mean audit log? POST request will record by default

https://abp.io/docs/latest/modules/audit-logging-pro

it works for me

@page
@using Microsoft.Extensions.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Abp.Data
@using Volo.Abp.Localization
@using Volo.Abp.ObjectExtending
@using Volo.Saas
@using Volo.Saas.Host.Pages.Saas.Host.Tenants
@using Volo.Saas.Localization
@model CreateModalModel
@inject IStringLocalizer<SaasResource> L
@inject IStringLocalizerFactory StringLocalizerFactory
@{
Layout = null;
}
<form method="post" asp-page="/Saas/Host/Tenants/CreateModal">
    <abp-modal>
        <abp-modal-header title="@L["NewTenant"].Value"></abp-modal-header>
        <abp-modal-body>
            <abp-tabs>
                <abp-tab title="Main Info">
                    <abp-input asp-for="Tenant.Name" />
                    <abp-input asp-for="Tenant.AdminEmailAddress" />
                    <div class="mb-3">
                        <label class="form-label">@L["DisplayName:AdminPassword"].Value</label>
                        <span> * </span>
                        <div class="input-group">
                            <input type="password" class="form-control" maxlength="@TenantConsts.MaxPasswordLength" asp-for="Tenant.AdminPassword" />
                            <button class="btn btn-secondary" type="button" id="PasswordVisibilityButton">
                                <i class="fa fa-eye-slash" aria-hidden="true"></i>
                            </button>
                        </div>
                        <span asp-validation-for="Tenant.AdminPassword"></span>
                    </div>
                </abp-tab>
                <abp-tab title="Extra">
                    @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.TenantInfoModel>())
                    {
                    if (!propertyInfo.Name.EndsWith("_Text"))
                    {
                    if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
                    {
                    if (propertyInfo.Type.IsEnum)
                    {
                    Model.Tenant.ExtraProperties.ToEnum(propertyInfo.Name, propertyInfo.Type);
                    }
                    <abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
                                label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
                                autocomplete-api-url="@propertyInfo.Lookup.Url"
                                autocomplete-selected-item-name="@Model.Tenant.GetProperty(propertyInfo.Name+"_Text")"
                                autocomplete-selected-item-value="@Model.Tenant.GetProperty(propertyInfo.Name)"
                                autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
                                autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
                                autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
                                autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>
                    }
                    else
                    {
                    <abp-input type="@propertyInfo.GetInputType()"
                               asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
                               label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
                               asp-format="@propertyInfo.GetInputFormatOrNull()"
                               value="@propertyInfo.GetInputValueOrNull(Model.Tenant.GetProperty(propertyInfo.Name))" />
                    }
                    }
                    }
                </abp-tab>
            </abp-tabs>
        </abp-modal-body>
        <abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
    </abp-modal>
</form>

Because, at the time, the database does not exist yet(maybe), so we change it to master

HI,

I shared the project with you yesterday, did you receive the email

You can publish an event in PalmaTenantDatabaseMigrationHandler

public async Task HandleEventAsync(TenantCreatedEto eventData)
{
    await MigrateAndSeedForTenantAsync(
        eventData.Id,
        eventData.Properties.GetOrDefault("AdminEmail") ?? "admin@abp.io",
        eventData.Properties.GetOrDefault("AdminPassword") ?? "1q2w3E*"
    );
    
    .....
    await eventBus.PublishAsync(new TenantSeededEto(...));
}
public class TenantEventHandler : IDistributedEventHandler<TenantSeededEto>, ITransientDependency
{
    private readonly IdentityUserManager _userManager;
    private readonly ICurrentTenant _currentTenant;

    public TenantEventHandler(IdentityUserManager userManager, ICurrentTenant currentTenant)
    {
        _userManager = userManager;
        _currentTenant = currentTenant;
    }

    public async Task HandleEventAsync(TenantSeededEto eventData)
    {
        ....
    }

Hi,

you can create a new project to test it

Showing 31 to 40 of 5638 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13