🍒 fix(Auth): 修复当业务层不存在IUserSessionExtProps扩展类时,UserManger刷新异常的问题

This commit is contained in:
喵你个汪呀 2025-09-04 12:13:56 +08:00
parent 82a7afb711
commit 839ff78203

View File

@ -331,7 +331,7 @@ public class SysAuthService : IDynamicApiController, ITransient
UnauthorizedPermissions = unauthorizedPermissions,
DataScopeList = user.AccountType == AccountTypeEnum.SuperAdmin ? [DataScopeEnum.All] : maxDataScope,
AppPermissions = loginMode == LoginModeEnum.APP ? LazyHelper.GetService<SysCommonService>().Value.GetAppApiList() : null,
ExtProps = App.GetServices<IUserManagerExtProps>().SelectMany(u => u.GetInitExtProps(user)).ToDictionary(u => u.Key, u => u.Value)
ExtProps = App.GetServices<IUserManagerExtProps>()?.SelectMany(u => u.GetInitExtProps(user)).Where(u => !string.IsNullOrWhiteSpace(u.Key)).ToDictionary(u => u.Key, u => u.Value)
});
}