Activities of "maliming"

hi

All projects should get a token from the Auth Server.

And the token will be validated by Auth Server website.


Will all your projects use the same identity users database?

Thanks.

Answer

我已经在framework中优化了这个方法

参考: https://github.com/abpframework/abp/pull/23622

Answer

如果用户和角色太多, 这样会造成更卡顿的情况

hi

Adding [RemoteService(false)] to all ClientProx classes will fix the problem.

This is because your app service is different from the standard one.

The client proxy assumes that each interface corresponds to a single implementation, but your interface has a generic base class.

public interface IWorkOrderAttachmentTypeAppService : IAttachmentTypeAppService<AttachmentTypeDto>

Thanks

I will check it asap.

Thanks.

Answer

好的, 我会在模块中修复它

Answer

你可以在app模版中尝试复现问题, 然后我们可以排除出问题.

Answer
var permissions = (await PermissionDefinitionManager.GetPermissionsAsync())
                .Where(x => notCacheKeys.Any(k => GetPermissionNameFormCacheKeyOrNull(k) == x.Name)).ToList();

改为

var names = notCacheKeys.Select(k => GetPermissionNameFormCacheKeyOrNull(k)).ToArray();

var permissions = (await PermissionDefinitionManager.GetPermissionsAsync())
    .Where(x => names .Any(k => k == x.Name)).ToList();

速度从6秒到几秒?

Answer

这几行虽然可以改进, 但是似乎也不会造成问题.

PermissionDefinitionManager不会查询数据库.

你可以分享一个项目复现问题吗?

liming.ma@volosoft.com

谢谢

Answer

这是我的单元测试代码, 你可以试试吗?

public class GetPermissionNameFormCacheKeyOrNull_Tests
{
    [Fact]
    public void Test()
    {
        var key = PermissionGrantCacheItem.CalculateCacheKey("Permission1", "Role", "1");
        key.ShouldBe("pn:Role,pk:1,n:Permission1");

        var stopwatch = System.Diagnostics.Stopwatch.StartNew();
        for (int i = 0; i < 50000; i++)
        {
            var name = PermissionGrantCacheItem.GetPermissionNameFormCacheKeyOrNull(key);
            name.ShouldBe("Permission1");
        }
        stopwatch.Stop();

        var elapsed = stopwatch.Elapsed.Seconds;
        elapsed.ShouldBeLessThan(2);


        var name2 = PermissionGrantCacheItem.GetPermissionNameFormCacheKeyOrNull("invalid-key");
        name2.ShouldBeNull();
    }
}

Showing 221 to 230 of 10719 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 16, 2025, 10:35