修改BUG:对新建角色、组、部门授权后由于缓存问题导致无法使用

This commit is contained in:
Argo-Lenovo 2017-04-13 16:49:48 +08:00
parent 37cf2565d8
commit 7af6ab8c40
2 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@ namespace Bootstrap.DataAccess
{
internal static class CacheCleanUtility
{
private const string BootstrapAdminPrincipalDataKey = "BootstrapAdminPrincipal-*";
/// <summary>
///
/// </summary>
@ -29,9 +30,11 @@ namespace Bootstrap.DataAccess
{
cacheKeys.Add(string.Format("{0}-{1}", UserHelper.RetrieveUsersByRoleIdDataKey, id));
cacheKeys.Add(string.Format("{0}-{1}", GroupHelper.RetrieveGroupsByRoleIdDataKey, id));
cacheKeys.Add(string.Format("{0}-{1}", MenuHelper.RetrieveMenusByRoleIdDataKey, id));
});
cacheKeys.Add(RoleHelper.RetrieveRolesDataKey + "*");
cacheKeys.Add(BootstrapMenu.RetrieveMenusDataKey + "*");
cacheKeys.Add(BootstrapAdminPrincipalDataKey);
}
if (userIds != null)
{
@ -53,6 +56,7 @@ namespace Bootstrap.DataAccess
});
cacheKeys.Add(GroupHelper.RetrieveGroupsDataKey + "*");
cacheKeys.Add(BootstrapMenu.RetrieveMenusDataKey + "*");
cacheKeys.Add(BootstrapAdminPrincipalDataKey);
}
if (menuIds != null)
{
@ -60,6 +64,7 @@ namespace Bootstrap.DataAccess
{
cacheKeys.Add(string.Format("{0}-{1}", RoleHelper.RetrieveRolesByMenuIdDataKey, id));
});
cacheKeys.Add(MenuHelper.RetrieveMenusByRoleIdDataKey + "*");
cacheKeys.Add(BootstrapMenu.RetrieveMenusDataKey + "*");
}
if (dictIds != null)

View File

@ -16,7 +16,10 @@ namespace Bootstrap.DataAccess
/// </summary>
public static class MenuHelper
{
private const string RetrieveMenusByRoleIdDataKey = "MenuHelper-RetrieveMenusByRoleId";
/// <summary>
///
/// </summary>
internal const string RetrieveMenusByRoleIdDataKey = "MenuHelper-RetrieveMenusByRoleId";
/// <summary>
/// 删除菜单信息
/// </summary>