Activities of "liangshiwei"

Answer

Hi,

You just need to use IRepository to get users.

Example:

public class UserAppService : ApplicationService, IUserAppService
{
    private readonly IRepository<AppUser, Guid> _appUserRepository;
    
    public UserAppService(IRepository<AppUser, Guid> appUserRepository)
    {
        appUserRepository = _appUserRepository;
    }
    
    public async Task<List<AppUserDto>> GetUserList()
    {
        return ObjectMapper.Map<AppUser,AppUserDto>(await _appUserRepository.GetListAsync());
    }
}
public partial class Index
{
    [Inject]
    protected IUserAppService UserAppService { get; set; }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        var users = await UserAppService.GetUserList();
        await base.OnAfterRenderAsync(firstRender);
    }
}

Display a loading indicator so the user knows something is actually happening.

See https://www.meziantou.net/showing-a-loading-screen-while-initializing-a-blazor-application.htm

Go straight to the Login page. Having to do a redirect from another page we don't want just to get to the login is crazy, and adds moire user frustration.

We are trying to impove performance of blazor app. Currently you can consider use blazor server version.

@abpVAndy

See https://docs.abp.io/en/abp/latest/UI/Angular/Custom-Setting-Page

Answer

This is not related to Csrf, I think your application config is not correct

See my comment:

I would like to go straightaway to the Login page and avoid that visual effect rendering Index page and then Login page, is that possible?

You cannot do this in the blazor front end, because in blazor applications, a refresh will reload the application(it will be slow). This solution should work: https://support.abp.io/QA/Questions/1152#answer-d2e834e0-4600-d3d0-eb47-39fbdb7edfc7

I would like to go straightaway to the Login page and avoid that visual effect rendering Index page and then Login page, is that possible?

You cannot do this in the blazor front end, because in blazor applications, a refresh will reload the application(it will be slow). This solution should work: https://support.abp.io/QA/Questions/1152#answer-d2e834e0-4600-d3d0-eb47-39fbdb7edfc7

And:

Maybe related https://github.com/abpframework/abp/issues/8240

Hi,

Try add YourProjectNameMongoModule depend to YourProjectNamePublicModule

Hi,

You can try put the MyLoggedOutModel.cs file to your .HttpApi.Host or .IdentityServer project

MyLoggedOutModel.cs

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(LoggedOutModel))]
public class MyLoggedOutModel : LoggedOutModel
{
    public override Task<IActionResult> OnGetAsync()
    {
        var blazorUrl = "https://<blazor>"; // front-end url
        if (PostLogoutRedirectUri.StartsWith(blazorUrl))
        {
            PostLogoutRedirectUri = $"https://<auth-server>/account/login?returnUrl={blazorUrl}";
            SignOutIframeUrl = null;
        }

        return base.OnGetAsync();
    }
}

@jward01

Open a new question, thanks.

Showing 5161 to 5170 of 5968 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11