Activités de "giathanh2512"

Répondre

Hi ,

I am unable to reproduce this issue. Please refer this https://docs.abp.io/en/abp/latest/UI/Blazor/Page-Progress .

Thanks,

I have tried following the documentation, but it doesn't work.

When I add the code you provided into HttpApi like this: Then, when I run project, I encounter this error:

Here is the result when running Blazor WebAssembly. When I run Blazor Server, I am unable to find the Screen-Url, and there is no data for Screen-Url being saved in the AuditLogs and EntityChange database tables.

Is the Blazor server a tiered solution?

Yes, that's correct.

It worked. Thank you very much.

But I'm still facing an issue. Currently, in Blazor WebAssembly, I have code in HttpApi.Client.

and I use context.GetHttpContext().Request.Headers["screen-url"].ToString(); to get the URL.

However, using this approach won't work in Blazor Server. Is there any way to retrieve the URL when using Blazor Server?

It seems that the project screenshot you sent is not mine. I have tried downloading and checking it. This is my project.

Sorry, I have sent you a new email. Please check it again.

Hi liangshiwei,

I have sent you an email, please check and assist me. Thanks.

Check the docs before asking a question: How to use extended field query in EF query?, [Filter User list by new extra property #784](https://support.abp.io/QA/Questions/784/Filter-User-list-by-new-extra-property), How to add custom property to the user entity,Module Entity Extensions | Documentation Center | ABP.IO ...

  • ABP Framework version: v8.0.2
  • UI Type: Blazor WASM / Blazor Server
  • Database System: EF Core (PostgreSQL)

Hi Support Teams,

I have two questions:

  1. Is there a way to use ScreenUrl within ExtraProperties instead of creating an additional ScreenUrl column and using EF.Property(u, "ScreenUrl") to write the query statement?

Below is my code.

2. How can I add `context.GetHttpContext().Request.Headers["screen-url"]` to the `ScreenUrl` column in `EntityChanges`? Currently, when I run it, it only adds it to the `ScreenUrl` in `ExtraProperties` but doesn't save it to the newly added `ScreenUrl` column.

public class ExtendedAuditLogContributor : AuditLogContributor
{
    public override void PreContribute(AuditLogContributionContext context)
    {  
        context.AuditInfo.SetProperty(
        "ScreenUrl",
            context.GetHttpContext().Request.Headers["screen-url"]
        );

    }

    public override void PostContribute(AuditLogContributionContext context)
    {
        var currentUser = context.ServiceProvider.GetRequiredService<ICurrentUser>();
         
        foreach (var change in context.AuditInfo.EntityChanges)
        {
            change.SetProperty(
            "ScreenUrl",
            context.GetHttpContext().Request.Headers["screen-url"]);

            change.SetProperty(
            "UserId", currentUser.Id); 
        }
    }
}

What if the data exceeds int.MaxValue?

Affichage de 11 à 20 sur 34 entrées
Made with ❤️ on ABP v8.2.0-preview Updated on mars 25, 2024, 15:11