| | |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using Tiger.Api.Controllers; |
| | | using Tiger.IBusiness; |
| | | using Tiger.IBusiness.Utility; |
| | | |
| | |
| | | opt.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver(); |
| | | opt.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; |
| | | }); |
| | | //services.AddControllers().AddApplicationPart(typeof(_WMSTestController).Assembly); |
| | | services.AddControllers().AddExtraControllers(); |
| | | |
| | | //配置跨域处理cors |
| | | services.AddCors(options => |
| | |
| | | app.UseEndpoints(endpoints => |
| | | { |
| | | endpoints.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}").RequireCors(anyAllowSpecificOrigins); |
| | | //endpoints.MapControllers().RequireCors(anyAllowSpecificOrigins); |
| | | endpoints.MapControllers().RequireCors(anyAllowSpecificOrigins); |
| | | }); |
| | | |
| | | ConsoleExt.Write($"Api Run as{((ApiConfig.IsDevVersion || ApiConfig.IsTestVersion) ? ((ApiConfig.IsDevVersion ? " Dev" : "") + (ApiConfig.IsTestVersion ? " Test" : "")) : " Release")} Edition", ConsoleColor.Cyan); |