修改BUG:修正全局样式覆盖个人设定样式BUG。

This commit is contained in:
Argo-MacBookPro 2018-09-07 16:11:18 +08:00
parent f3d3358b81
commit 0c4d8f496f
5 changed files with 12 additions and 26 deletions

View File

@ -1,7 +1,5 @@
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Bootstrap.Security;
using System.Security.Principal;
using System.Web;
namespace Bootstrap.Admin.Models
{
@ -16,7 +14,7 @@ namespace Bootstrap.Admin.Models
Icon = user.Icon;
DisplayName = user.DisplayName;
UserName = user.UserName;
Css = user.Css;
if (!string.IsNullOrEmpty(user.Css)) Theme = user.Css;
}
public string UserName { get; }
/// <summary>
@ -31,9 +29,5 @@ namespace Bootstrap.Admin.Models
/// 获得/设置 用户头像地址
/// </summary>
public string Icon { get; }
/// <summary>
///
/// </summary>
public string Css { get; }
}
}

View File

@ -27,6 +27,6 @@ namespace Bootstrap.Admin.Models
/// <summary>
///
/// </summary>
public string Theme { get; private set; }
public string Theme { get; protected set; }
}
}

View File

@ -84,16 +84,9 @@
<div class="dropdown-menu">
<a href="#" data-val="">默认样式</a>
@foreach (var css in Model.Themes)
{
if (css.Code == Model.Css)
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
else
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
}
</div>
</div>
</div>

View File

@ -52,16 +52,9 @@
<div class="dropdown-menu">
<a href="#" data-val="">默认样式</a>
@foreach (var css in Model.Themes)
{
if (css.Code == Model.Css)
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
else
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
}
</div>
</div>
<button class="btn btn-secondary" type="button" data-method="css">保存</button>

View File

@ -52,7 +52,13 @@
break;
case 'css':
data.UserStatus = 'ChangeTheme';
$.bc({ url: User.url, method: "PUT", data: data, title: "保存样式" });
$.bc({
url: User.url, method: "PUT", data: data, title: "保存样式", callback: function (result) {
if (result) {
window.setTimeout(function () { window.location.reload(true); }, 1000);
}
}
});
break;
}
});