mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-23 11:37:21 +08:00
【新增】增加易联云小票打印机后台配置表【CoreCmsPrinter】,取消使用配置文件配置,并且支持多台打印机绑定不同门店,实现不同门店不同打印机打单。
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Autofac;
|
||||
using AutoMapper;
|
||||
using CoreCms.Net.Auth;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Core.AutoFac;
|
||||
@@ -12,7 +11,6 @@ using CoreCms.Net.Swagger;
|
||||
using CoreCms.Net.Task;
|
||||
using Hangfire;
|
||||
using Hangfire.Dashboard.BasicAuthorization;
|
||||
using InitQ;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -24,12 +22,8 @@ using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using Qc.YilianyunSdk;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CoreCms.Net.RedisMQ.Subscribe;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.WeChat.Service.Mediator;
|
||||
using Essensoft.Paylink.Alipay;
|
||||
using Essensoft.Paylink.WeChatPay;
|
||||
@@ -80,12 +74,12 @@ namespace CoreCms.Net.Web.WebApi
|
||||
//配置跨域(CORS)
|
||||
services.AddCorsSetup();
|
||||
|
||||
|
||||
//添加session支持(session依赖于cache进行存储)
|
||||
services.AddSession();
|
||||
// AutoMapper支持
|
||||
services.AddAutoMapper(typeof(AutoMapperConfiguration));
|
||||
|
||||
|
||||
//MediatR(只需要注册一个,同项目或类库下就不需要注册多个)
|
||||
services.AddMediatR(typeof(TextMessageEventCommand).Assembly);
|
||||
|
||||
@@ -104,6 +98,7 @@ namespace CoreCms.Net.Web.WebApi
|
||||
services.Configure<AlipayOptions>(Configuration.GetSection("Alipay"));
|
||||
|
||||
|
||||
|
||||
//注册自定义微信接口配置文件
|
||||
services.Configure<WeChat.Service.Options.WeChatOptions>(Configuration.GetSection(nameof(WeChat.Service.Options.WeChatOptions)));
|
||||
|
||||
@@ -117,13 +112,9 @@ namespace CoreCms.Net.Web.WebApi
|
||||
//Swagger接口文档注入
|
||||
services.AddClientSwaggerSetup();
|
||||
|
||||
//配置易联云打印机
|
||||
services.AddYiLianYunSetup();
|
||||
|
||||
//注册Hangfire定时任务
|
||||
services.AddHangFireSetup();
|
||||
|
||||
|
||||
//授权支持注入
|
||||
services.AddAuthorizationSetupForClient();
|
||||
//上下文注入
|
||||
@@ -144,7 +135,7 @@ namespace CoreCms.Net.Web.WebApi
|
||||
})
|
||||
.AddNewtonsoftJson(p =>
|
||||
{
|
||||
//数据格式首字母小写 不使用驼峰
|
||||
//数据格式首字母小写 不使用大驼峰
|
||||
p.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
|
||||
//不使用驼峰样式的key
|
||||
//p.SerializerSettings.ContractResolver = new DefaultContractResolver();
|
||||
@@ -154,6 +145,7 @@ namespace CoreCms.Net.Web.WebApi
|
||||
p.SerializerSettings.DateFormatString = "yyyy/MM/dd HH:mm:ss";
|
||||
});
|
||||
|
||||
|
||||
// 雪花漂移算法
|
||||
// 创建 IdGeneratorOptions 对象,请在构造函数中输入 WorkerId:
|
||||
var options = new IdGeneratorOptions(1);
|
||||
@@ -193,7 +185,7 @@ namespace CoreCms.Net.Web.WebApi
|
||||
/// <param name="env"></param>
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
#region 解决Ubuntu Nginx 代理不能获取IP问题()
|
||||
#region 解决Ubuntu Nginx 代理不能获取IP问题
|
||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
{
|
||||
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
|
||||
@@ -256,10 +248,7 @@ namespace CoreCms.Net.Web.WebApi
|
||||
{
|
||||
filter
|
||||
},
|
||||
IsReadOnlyFunc = Context =>
|
||||
{
|
||||
return false;//是否只读面板
|
||||
}
|
||||
IsReadOnlyFunc = _ => false
|
||||
};
|
||||
|
||||
app.UseHangfireDashboard("/job", options); //可以改变Dashboard的url
|
||||
@@ -267,9 +256,6 @@ namespace CoreCms.Net.Web.WebApi
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
//使用 Session
|
||||
app.UseSession();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user