refactor: 个人中心维护界面默认应用名称直接获取

This commit is contained in:
Argo Windows 2019-10-30 11:12:29 +08:00
parent 2d0fba0eac
commit 7149bcb61b
3 changed files with 9 additions and 2 deletions

View File

@ -36,7 +36,6 @@ namespace Bootstrap.Admin.Models
// 后台系统网站图标跟随个人中心设置的默认应用站点的展示
WebSiteIcon = DictHelper.RetrieveWebIcon(AppId);
WebSiteLogo = DictHelper.RetrieveWebLogo(AppId);
}
}

View File

@ -25,6 +25,11 @@ namespace Bootstrap.Admin.Models
/// </summary>
public bool External { get; }
/// <summary>
/// 获得 当前用户默认应用程序名称
/// </summary>
public string AppName { get; }
/// <summary>
///
/// </summary>
@ -46,6 +51,9 @@ namespace Bootstrap.Admin.Models
}
if (controller.User.Identity.AuthenticationType != Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationDefaults.AuthenticationScheme) External = true;
// 设置 当前用户默认应用名称
AppName = Applications.FirstOrDefault(app => app.Key == AppId).Value;
}
}
}

View File

@ -87,7 +87,7 @@
<div class="card-body">
<div class="form-group">
<div class="btn-group" role="group">
<button id="app" class="btn btn-success dropdown-select dropdown-toggle" data-toggle="dropdown" data-default-val="" value="@Model.AppId">未设置</button>
<button id="app" class="btn btn-success dropdown-select dropdown-toggle" data-toggle="dropdown" value="@Model.AppId">@Model.AppName</button>
<div class="dropdown-menu">
@foreach (var app in Model.Applications)
{