mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 18:22:11 +08:00
sync with OpenAuth.Core
This commit is contained in:
@@ -91,13 +91,17 @@ namespace OpenAuth.WebApi.Controllers
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
private static string lockobj = "lock";
|
||||
[HttpPost]
|
||||
public Response UnAssignDataProperty(AssignDataReq request)
|
||||
{
|
||||
var result = new Response();
|
||||
try
|
||||
{
|
||||
_app.UnAssignData(request);
|
||||
lock (lockobj)
|
||||
{
|
||||
_app.UnAssignData(request);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@@ -67,7 +67,6 @@ namespace OpenAuth.WebApi.Controllers
|
||||
/// <param name="files"></param>
|
||||
/// <returns>服务器存储的文件信息</returns>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public Response<IList<UploadFile>> Upload(IFormFileCollection files)
|
||||
{
|
||||
var result = new Response<IList<UploadFile>>();
|
||||
|
@@ -41,8 +41,10 @@ namespace OpenAuth.WebApi.Controllers
|
||||
return result;
|
||||
}
|
||||
|
||||
//添加或修改
|
||||
[HttpPost]
|
||||
/// <summary>
|
||||
/// 添加角色,如果当前登录用户不是System,则直接把新角色分配给当前登录用户
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public Response<RoleView> Add(RoleView obj)
|
||||
{
|
||||
var result = new Response<RoleView>();
|
||||
@@ -60,8 +62,12 @@ namespace OpenAuth.WebApi.Controllers
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//添加或修改
|
||||
|
||||
/// <summary>
|
||||
/// 更新角色属性
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Response Update(RoleView obj)
|
||||
{
|
||||
|
@@ -17,8 +17,6 @@ namespace OpenAuth.WebApi
|
||||
.ConfigureLogging((hostingContext, logging) =>
|
||||
{
|
||||
logging.ClearProviders(); //去掉默认的日志
|
||||
logging.AddFilter("System", LogLevel.Error);
|
||||
logging.AddFilter("Microsoft", LogLevel.Error);
|
||||
logging.AddLog4Net();
|
||||
})
|
||||
.UseServiceProviderFactory(
|
||||
|
@@ -4,10 +4,10 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using Autofac;
|
||||
using IdentityServer4.AccessTokenValidation;
|
||||
using Infrastructure.Extensions;
|
||||
using Infrastructure.Extensions.AutofacManager;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -38,6 +38,11 @@ namespace OpenAuth.WebApi
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<ApiBehaviorOptions>(options =>
|
||||
{
|
||||
options.SuppressModelStateInvalidFilter = true;
|
||||
});
|
||||
|
||||
services.AddSingleton(provider =>
|
||||
{
|
||||
var service = provider.GetRequiredService<ILogger<StartupLogger>>();
|
||||
@@ -161,8 +166,10 @@ namespace OpenAuth.WebApi
|
||||
}
|
||||
|
||||
// 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();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
|
@@ -2,8 +2,9 @@
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
"System": "Error",
|
||||
"Microsoft": "Error",
|
||||
"Microsoft.EntityFrameworkCore.Database.Command": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user