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