Browse Source
Fix cache key and user ID parsing logic
pull/24486/head
maliming
3 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
3 additions and
3 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs
-
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs
|
|
|
@ -18,8 +18,8 @@ public class MvcCachedApplicationConfigurationClientHelper : ITransientDependenc |
|
|
|
public virtual async Task<string> CreateCacheKeyAsync(Guid? userId) |
|
|
|
{ |
|
|
|
var appVersion = await ApplicationVersionCache.GetOrAddAsync(MvcCachedApplicationVersionCacheItem.CacheKey, |
|
|
|
() => Task.FromResult(new MvcCachedApplicationVersionCacheItem(Guid.NewGuid().ToString()))) ?? |
|
|
|
new MvcCachedApplicationVersionCacheItem(Guid.NewGuid().ToString()); |
|
|
|
() => Task.FromResult(new MvcCachedApplicationVersionCacheItem(Guid.NewGuid().ToString("N")))) ?? |
|
|
|
new MvcCachedApplicationVersionCacheItem(Guid.NewGuid().ToString("N")); |
|
|
|
var userKey = userId?.ToString("N") ?? "Anonymous"; |
|
|
|
return $"ApplicationConfiguration_{appVersion.Version}_{userKey}_{CultureInfo.CurrentUICulture.Name}"; |
|
|
|
} |
|
|
|
|
|
|
|
@ -108,7 +108,7 @@ public class PermissionManagementModal : AbpPageModel |
|
|
|
); |
|
|
|
|
|
|
|
Guid? userId = null; |
|
|
|
if (ProviderName == UserPermissionValueProvider.ProviderName && Guid.TryParse(ProviderName, out var parsedUserId)) |
|
|
|
if (ProviderName == UserPermissionValueProvider.ProviderName && Guid.TryParse(ProviderKey, out var parsedUserId)) |
|
|
|
{ |
|
|
|
userId = parsedUserId; |
|
|
|
} |
|
|
|
|