feat: 角色对用户授权页面用户显示名为空时显示登录用户名

This commit is contained in:
Argo Zhang 2020-02-06 13:25:23 +08:00
parent 7ef09fae6c
commit 36d71bfb89
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ $(function () {
callback: function (result) {
var htmlTemplate = this.htmlTemplate;
var html = $.map(result, function (element, index) {
return $.format(htmlTemplate, element.Id, element.DisplayName, element.Checked, element.UserName);
var displayName = element.DisplayName;
if (displayName === "") displayName = element.UserName;
return $.format(htmlTemplate, element.Id, displayName, element.Checked, element.UserName);
}).join('');
$dialogUserHeader.text($.format('{0}-用户授权窗口', row.RoleName));
$dialogUserForm.html(html).find('[data-toggle="tooltip"]').each(function (index, label) {