Browse Source

修改SettleAccount的CORS配置和BaseService统一;修改SettleAccount的Swagger配置添加JWT Token配置

master
wanggang 1 year ago
parent
commit
a0c1e086d6
  1. 19
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs
  2. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

19
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs

@ -366,6 +366,25 @@ namespace Win.Sfs.SettleAccount
{ {
options.IncludeXmlComments(xmlapppath); options.IncludeXmlComments(xmlapppath);
} }
options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
{
Description = "请输入 JWT Token",
Name = "Authorization",
In = ParameterLocation.Header,
Type = SecuritySchemeType.Http,
Scheme = "Bearer"
});
options.AddSecurityRequirement(new OpenApiSecurityRequirement()
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference {Type = ReferenceType.SecurityScheme, Id = "Bearer"}
},
new string[] { }
}
});
}); });
} }

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -1,6 +1,6 @@
{ {
"App": { "App": {
"CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088" "CorsOrigins": "https://*.abc.com,http://localhost:9527,http://149.223.116.5:8088"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True", "Default": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True",

Loading…
Cancel
Save