修改BUG,如果登陆用户是网站配置的超级管理员,无法显示DisplayName导致异常
This commit is contained in:
parent
8d81c4b85d
commit
a69c9df63e
|
@ -61,6 +61,7 @@ namespace Bootstrap.DataAccess
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static User RetrieveUsersByName(string userName)
|
public static User RetrieveUsersByName(string userName)
|
||||||
{
|
{
|
||||||
|
if (Longbow.Security.Principal.LgbPrincipal.IsAdmin(userName)) return new User() { DisplayName = "网站管理员", UserName = userName };
|
||||||
string key = string.Format("{0}{1}", UserDisplayNameDataKey, userName);
|
string key = string.Format("{0}{1}", UserDisplayNameDataKey, userName);
|
||||||
return CacheManager.GetOrAdd(key, CacheSection.RetrieveIntervalByKey(UserDisplayNameDataKey), k =>
|
return CacheManager.GetOrAdd(key, CacheSection.RetrieveIntervalByKey(UserDisplayNameDataKey), k =>
|
||||||
{
|
{
|
||||||
|
@ -241,10 +242,10 @@ namespace Bootstrap.DataAccess
|
||||||
transaction.CommitTransaction();
|
transaction.CommitTransaction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret= true;
|
ret = true;
|
||||||
ClearCache();
|
ClearCache();
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
ExceptionManager.Publish(ex);
|
ExceptionManager.Publish(ex);
|
||||||
transaction.RollbackTransaction();
|
transaction.RollbackTransaction();
|
||||||
|
|
Loading…
Reference in New Issue