修改BUG:网站默认样式被应用两次

This commit is contained in:
Argo-Lenovo 2016-12-16 10:34:36 +08:00
parent 8b29ff7160
commit 9dd7283cb2
3 changed files with 5 additions and 3 deletions

View File

@ -347,7 +347,8 @@ $(function () {
$.bc({
Id: 1, url: Dicts.url, data: { type: 'activeCss' }, swal: false,
callback: function (result) {
$('head').append($.format('<link href="../Content/css/{0}" rel="stylesheet" type="text/css" />', result[0].Code));
if (result.length > 0)
$('head').append($.format('<link href="../Content/css/{0}" rel="stylesheet" type="text/css" />', result[0].Code));
}
});
if ($.isFunction($.validator)) {

View File

@ -176,7 +176,8 @@
$.bc({
Id: 1, url: Dicts.url, data: { type: 'activeCss' }, swal: false,
callback: function (result) {
$('#dictCssDefine').selectval(result[0].Code);
if (result.length > 0)
$('#dictCssDefine').selectval(result[0].Code);
}
});
}

View File

@ -171,7 +171,7 @@ namespace Bootstrap.DataAccess
public static IEnumerable<Dict> RetrieveActiveCss()
{
var data = RetrieveDicts();
return data.Where(d => d.Category == "当前样式");
return data.Where(d => d.Category == "当前样式" && !d.Code.Equals("site.css", StringComparison.OrdinalIgnoreCase));
}
/// <summary>
/// 保存网站个性化设置