同步OpenAuth.Core

修复mvc三级菜单;
Reposiroty单元测试读取webapi配置文件;
修复日志打印2次;
This commit is contained in:
yubaolee
2021-02-20 22:06:02 +08:00
parent ecc32d4173
commit 679dc613c1
13 changed files with 126 additions and 21 deletions

View File

@@ -17,9 +17,6 @@ namespace OpenAuth.Mvc
.ConfigureLogging((hostingContext, logging) =>
{
logging.ClearProviders(); //去掉默认的日志
logging.AddFilter("System", LogLevel.Error);
logging.AddFilter("Microsoft", LogLevel.Error);
logging.AddLog4Net();
})
.UseServiceProviderFactory(new AutofacServiceProviderFactory()) //将默认ServiceProviderFactory指定为AutofacServiceProviderFactory
.ConfigureWebHostDefaults(webBuilder =>

View File

@@ -109,8 +109,10 @@ namespace OpenAuth.Mvc
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostEnvironment env)
public void Configure(IApplicationBuilder app, IHostEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddLog4Net();
app.UseAuthentication();
if (env.IsDevelopment())
{

View File

@@ -2,8 +2,9 @@
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
"System": "Error",
"Microsoft": "Error",
"Microsoft.EntityFrameworkCore.Database.Command": "Information"
}
}
}

View File

@@ -202,3 +202,11 @@
.top_menu .layui-nav-item.showNotice[pc]{ display:none !important; }
.panel{ width:100%; }
}
ol li a {
background-color: rgba(0,0,0,1) !important;
}
.three_this {
background-color: #808080 !important;
}

View File

@@ -9,7 +9,23 @@ layui.config({
tab = layui.bodyTab({
openTabNum : "50", //最大可打开窗口数量
url: "/UserSession/GetModulesTree" //获取菜单json地址
});
});
$(".menu_three").on("click", function () {
$(this).next().toggle();
$.each($(this).parent().siblings(), function (i, e) {
$(e).find("ol").hide();;
});
})
$("ol").on("click", "li a", function () {
$.each($(this).parent().siblings(), function (i, e) {
$(e).find("a").removeClass('three_this')
});
$(this).addClass('three_this'); // 添加当前元素的样式
})
$.get('/UserSession/GetUserName',
function(data) {

View File

@@ -32,7 +32,37 @@ function navBar(strData){
if(data[i].Children[j].Item.IconName != undefined && data[i].Children[j].Item.IconName != ''){
ulHtml += '<i class="layui-icon '+ data[i].Children[j].Item.IconName +'"></i>'
}
ulHtml += '<cite>'+data[i].Children[j].Item.Name+'</cite></a></dd>';
ulHtml += '<cite>' + data[i].Children[j].Item.Name + '</cite></a>';
if (data[i].Children[j].Children != undefined && data[i].Children[j].Children.length > 0) {
let idx = 0;
for (var k = 0; k < data[i].Children[j].Children.length; k++) {
if (data[i].Children[j].Children[k].Item.Status === -1) continue;
idx++;
if (idx == 1) {
ulHtml += '<ol class="layui-nav-child">';
}
if (data[i].Children[j].Children[k].target == "_blank") {
ulHtml += '<li><a href="javascript:;" data-url="' + data[i].Children[j].Children[k].Item.Url + '" target="' + data[i].Children[j].Children[k].target + '">';
} else {
ulHtml += '<li><a href="javascript:;" data-url="' + data[i].Children[j].Children[k].Item.Url + '">';
}
if (data[i].Children[j].Children[k].Item.IconName != undefined && data[i].Children[j].Children[k].Item.IconName != '') {
ulHtml += '&nbsp;&nbsp;&nbsp;&nbsp;<i class="layui-icon ' + data[i].Children[j].Children[k].Item.IconName + '"></i>'
}
ulHtml += '<cite>' + data[i].Children[j].Children[k].Item.Name + '</cite></a ></li > ';
}
if (idx > 0) {
ulHtml += '</ol>';
}
}
}
ulHtml += "</dl>";
}else{