feat: 个人中心与用户管理更新用户名时同步到header
This commit is contained in:
parent
ca7eb3dde5
commit
34b4c45792
|
@ -10,7 +10,7 @@
|
||||||
<div class="nav-header flex-fill align-items-center">
|
<div class="nav-header flex-fill align-items-center">
|
||||||
<a href="~/Admin/Profiles">
|
<a href="~/Admin/Profiles">
|
||||||
<img src="@Url.Content(Model.Icon)" />
|
<img src="@Url.Content(Model.Icon)" />
|
||||||
<span class="d-inline-block font-weight-bold flex-fill">@Model.DisplayName</span>
|
<span class="username d-inline-block text-truncate font-weight-bold flex-fill">@Model.DisplayName</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- sidebar menu start-->
|
<!-- sidebar menu start-->
|
||||||
|
|
|
@ -136,8 +136,10 @@ aside {
|
||||||
left: 4px;
|
left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
aside .nav-header span {
|
aside .nav-header .username {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
|
max-width: 120px;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
aside .nav-link span {
|
aside .nav-link span {
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
url: Profiles.url, method: "put", data: data, title: "修改用户显示名称",
|
url: Profiles.url, method: "put", data: data, title: "修改用户显示名称",
|
||||||
callback: function (result) {
|
callback: function (result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
$('#userDisplayName').text(data.DisplayName);
|
$('#userDisplayName, .nav-header .username').text(data.DisplayName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -75,7 +75,7 @@ $(function () {
|
||||||
},
|
},
|
||||||
callback: function (data) {
|
callback: function (data) {
|
||||||
if (data && data.success && data.oper === 'save' && data.data.UserName === $('#userDisplayName').attr('data-userName')) {
|
if (data && data.success && data.oper === 'save' && data.data.UserName === $('#userDisplayName').attr('data-userName')) {
|
||||||
$('#userDisplayName').text(data.data.DisplayName);
|
$('#userDisplayName, .nav-header .username').text(data.data.DisplayName);
|
||||||
}
|
}
|
||||||
if (data && data.oper === 'create') {
|
if (data && data.oper === 'create') {
|
||||||
$('#userName').prop('readonly', false).removeClass("ignore");
|
$('#userName').prop('readonly', false).removeClass("ignore");
|
||||||
|
|
Loading…
Reference in New Issue