Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe
This commit is contained in:
commit
d8e380f744
@ -39,13 +39,13 @@ namespace APT.FM.WebApi
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
|
||||
|
||||
var repository = LogManager.GetRepository
|
||||
(System.Reflection.Assembly.GetEntryAssembly());
|
||||
var fileInfo = new FileInfo("log4net.config");
|
||||
if(!fileInfo.Exists)
|
||||
fileInfo=new FileInfo(Path.Combine(System.AppContext.BaseDirectory, "log4net.config"));
|
||||
XmlConfigurator.Configure(repository, fileInfo);
|
||||
var fileInfo = new FileInfo("log4net.config");
|
||||
if (!fileInfo.Exists)
|
||||
fileInfo = new FileInfo(Path.Combine(System.AppContext.BaseDirectory, "log4net.config"));
|
||||
XmlConfigurator.Configure(repository, fileInfo);
|
||||
ConfigurationManager.Register(configuration);
|
||||
InitUtils.Init();
|
||||
}
|
||||
@ -69,8 +69,9 @@ namespace APT.FM.WebApi
|
||||
services.AddCors(o => o.AddPolicy("AllowAllPolicy", builder =>
|
||||
{
|
||||
builder.AllowAnyOrigin()
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader();
|
||||
.AllowAnyHeader() // 允许任何头
|
||||
.AllowAnyMethod() // 允许任何方法
|
||||
;
|
||||
}));
|
||||
|
||||
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
@ -113,13 +114,13 @@ namespace APT.FM.WebApi
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Infrastructure.Api.HttpContext.Register(app.ApplicationServices.
|
||||
GetRequiredService<IHttpContextAccessor>()
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
app.UseCors("AllowAllPolicy");
|
||||
|
||||
@ -134,7 +135,7 @@ namespace APT.FM.WebApi
|
||||
app.UseMvc();
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
|
||||
|
||||
//fMOrganizationService.SetOrgCache();
|
||||
|
||||
@ -147,6 +148,6 @@ namespace APT.FM.WebApi
|
||||
builder.RegisterComponents();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ namespace APT.PF.WebApiControllers.Api.PF
|
||||
var userFilter = new BaseFilter(orgId);
|
||||
//userFilter.IgnoreOrgRule = true;
|
||||
//userFilter.IsMultipleDb = true;//多库查询
|
||||
user.ORG_ID = orgId;
|
||||
userFilter.OrgId = orgId;
|
||||
userFilter.SelectField = new string[] { "CODE", "Nav_ProdutionUnit.Nav_Enums.VALUE", "DEPARTMENT_ID" };
|
||||
user = this.GetEntity<T_FM_USER>(expression, userFilter);
|
||||
if (user == null)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user