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

View File

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

View File

@ -85,14 +85,7 @@
<a href="#" data-val="">默认样式</a> <a href="#" data-val="">默认样式</a>
@foreach (var css in Model.Themes) @foreach (var css in Model.Themes)
{ {
if (css.Code == Model.Css) <a href="#" data-val="@css.Code">@css.Name</a>
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
else
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
} }
</div> </div>
</div> </div>

View File

@ -53,14 +53,7 @@
<a href="#" data-val="">默认样式</a> <a href="#" data-val="">默认样式</a>
@foreach (var css in Model.Themes) @foreach (var css in Model.Themes)
{ {
if (css.Code == Model.Css) <a href="#" data-val="@css.Code">@css.Name</a>
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
else
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
} }
</div> </div>
</div> </div>

View File

@ -52,7 +52,13 @@
break; break;
case 'css': case 'css':
data.UserStatus = 'ChangeTheme'; 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; break;
} }
}); });