/// <summary> /// 事件处理 /// </summary> /// <param name="eventData">事件源数据</param> public override void Handle(FunctionAuthCacheRefreshEventData eventData) { if (!_provider.InHttpRequest()) { return; } IFunctionAuthCache cache = _provider.GetService <IFunctionAuthCache>(); if (eventData.FunctionIds.Length > 0) { cache.RemoveFunctionCaches(eventData.FunctionIds); foreach (Guid functionId in eventData.FunctionIds) { cache.GetFunctionRoles(functionId); } } if (eventData.UserNames.Length > 0) { cache.RemoveUserCaches(eventData.UserNames); foreach (string userName in eventData.UserNames) { cache.GetUserFunctions(userName); } } }