Activities of "liangshiwei"

Hi,

Sorry I forgot your project version, this way only work for projects starting in 4.0.

Using cookies requires your backend and frontend to be on the same domain&port. Maybe you can use cache to store access_token.

I can help you remotely. shiwei.liang@volosoft.com

Hi,

Try:

public class MyProjectNameMenuContributor : IMenuContributor
{
    public async Task ConfigureMenuAsync(MenuConfigurationContext context)
    {
        if (context.Menu.Name == StandardMenus.User)
        {
            context.Menu.Items.RemoveAll(x => x.Name == "Account.SecurityLogs");
        }
    }
}

Create Default.cshtml in the Themes\Lepton\Components\Toolbar\UserMenu directory:

@using Localization.Resources.AbpUi
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.MultiTenancy
@using Volo.Abp.UI.Navigation
@using Volo.Abp.Users
@inject ICurrentUser CurrentUser
@inject ICurrentTenant CurrentTenant
@inject IHtmlLocalizer<AbpUiResource> L
@model ApplicationMenu

<abp-dropdown>
    <abp-dropdown-button link="true" id="dropdownMenuUser">
        <img src="@($"/api/account/profile-picture-file/{CurrentUser.GetId()}")" width="21" class="user-avatar">

        @if (@CurrentUser.TenantId != null)
        {
            <span><i>@CurrentTenant.Name</i>\@CurrentUser.UserName</span>
        }
        else
        {
            <span>@CurrentUser.UserName</span>
        }

    </abp-dropdown-button>

    <abp-dropdown-menu align="Right" aria-labelledby="dropdownMenuUser">
        <abp-row class="p-2">
            <abp-column size="Auto" class="pr-0">
                <img src="@($"/api/account/profile-picture-file/{CurrentUser.GetId()}")" class="user-avatar-big" width="48">               
            </abp-column>
            <abp-column class="pl-2">
                <span>@L["Welcome"]</span><br />
                @if (@CurrentUser.TenantId != null)
                {
                    <small><i>@CurrentTenant.Name</i>\</small><strong>@CurrentUser.UserName</strong>
                }
                else
                {
                    <strong>@CurrentUser.UserName</strong>
                }
            </abp-column>
        </abp-row>
        @if (Model.Items.Any())
        {
            <abp-dropdown-divider />
            foreach (var menuItem in Model.Items)
            {
                var elementId = string.IsNullOrEmpty(menuItem.ElementId) ? string.Empty : menuItem.ElementId;
                var cssClass = string.IsNullOrEmpty(menuItem.CssClass) ? string.Empty : menuItem.CssClass;
                var disabled = menuItem.IsDisabled ? "disabled" : string.Empty;
                var url = string.IsNullOrEmpty(menuItem.Url) ? "#" : Url.Content(menuItem.Url);

                if(menuItem.Name == "Account.Manage")
                {
                    url += "?returnUrl=" + Url.PageLink();
                }

                <abp-dropdown-item class="@cssClass @disabled" href="@url" id="@elementId" target="@menuItem.Target">
                    @menuItem.DisplayName
                </abp-dropdown-item>
            }
        }
    </abp-dropdown-menu>
</abp-dropdown>


If it is empty, you can return null directly without decrypt

Hi,

This is a problem ,we will fix it soon. thanks for you reporting. See https://github.com/abpframework/abp/pull/7165

Hi,

You should download the source code of the rel-4.1 branch instead of dev branch

Can I check it remotely?(UTC+8) shiwei.liang@volosoft.com

Hi,

Have you tried my suggestion?

Hi,

As hikalkan said, your sql execution may not be in the transaction. Below is my test code and it works fine:

public class TestAppService : ApplicationService
{
    private readonly IMyRepository _myRepository;

    public TestAppService(IMyRepository myRepository)
    {
        _myRepository = myRepository;
    }

    public async Task UpdateManyAsync()
    {
        var roleIds = (await _myRepository.GetListAsync()).Select(x => x.Id).ToArray();

        await _myRepository.UpdateManyAsync(roleIds);

        await CurrentUnitOfWork.SaveChangesAsync();

        throw new UserFriendlyException("test exception");
    }
}

public class MyRepository : EfCoreRepository<IdentityDbContext, IdentityRole, Guid>, IMyRepository
{
    public MyRepository(IDbContextProvider<IdentityDbContext> dbContextProvider) : base(dbContextProvider)
    {
    }

    public async Task UpdateManyAsync(Guid[] ids)
    {
        var parameter =  string.Join(',',ids.Select(x => $"'{x}'").ToList());
        await DbContext.Database.ExecuteSqlRawAsync(
            $"update AbpRoles set IsPublic = 1 where id in ({parameter})");
    }
}

Hi,

I make an example and hope can help you: https://github.com/realLiangshiwei/Qa727

Hi,

How to reproduce this problem? can you provide steps? thanks.

Showing 5281 to 5290 of 5957 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11