郑勃旭 2 years ago
parent
commit
2cb34ef31f
  1. 2
      be/.gitattributes
  2. 35
      be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs
  3. 1
      build/src/docker/.gitignore
  4. 4
      build/src/docker/publish/apps/be/Web.Gateway/Web.Gateway.deps.json
  5. BIN
      build/src/docker/publish/apps/be/Web.Gateway/Web.Gateway.dll
  6. BIN
      build/src/docker/publish/apps/be/Web.Gateway/Web.Gateway.exe
  7. BIN
      build/src/docker/publish/apps/be/Web.Gateway/Web.Gateway.pdb
  8. 2
      build/src/docker/publish/apps/be/Web.Gateway/appsettings.Production.json
  9. 34
      build/src/docker/publish/apps/be/Web.Gateway/appsettings.json
  10. 6824
      build/src/docker/publish/apps/be/Web.Gateway/logs/log.txt
  11. 9
      build/src/docker/publish/conf/gateway/appsettings.json

2
be/.gitattributes

@ -1,2 +1,4 @@
* text=auto eol=lf * text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
**/wwwroot/libs/** linguist-vendored **/wwwroot/libs/** linguist-vendored

35
be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs

@ -208,7 +208,7 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
app.UseCorrelationId(); app.UseCorrelationId();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseRouting(); app.UseRouting();
app.UseCors(); app.UseCors("Default");
app.UseAuthentication(); app.UseAuthentication();
app.UseJwtTokenMiddleware(); app.UseJwtTokenMiddleware();
app.UseUnitOfWork(); app.UseUnitOfWork();
@ -246,20 +246,27 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
Console.WriteLine($"CORS Origins:{string.Concat(origins)}"); Console.WriteLine($"CORS Origins:{string.Concat(origins)}");
ServiceConfigurationContext.Services.AddCors(options => ServiceConfigurationContext.Services.AddCors(options =>
{ {
options.AddDefaultPolicy(builder => //options.AddDefaultPolicy(builder =>
//{
// builder
// .WithOrigins(
// origins
// .Select(o => o.RemovePostFix("/"))
// .ToArray()
// )
// //.AllowAnyOrigin()//允许所有跨域
// //.WithAbpExposedHeaders()
// .SetIsOriginAllowedToAllowWildcardSubdomains()
// .AllowAnyHeader()
// .AllowAnyMethod()
// .AllowCredentials();//按配置文件中 跨域
//});
options.AddPolicy("Default", builder =>
{ {
builder builder.SetIsOriginAllowed(isOriginAllowed => true)
.WithOrigins( .AllowAnyMethod()
origins .AllowAnyHeader()
.Select(o => o.RemovePostFix("/")) .AllowCredentials();
.ToArray()
)
//.AllowAnyOrigin()//允许所有跨域
//.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();//按配置文件中 跨域
}); });
}); });
} }

1
build/src/docker/.gitignore

@ -1,2 +1,3 @@
publish/data publish/data
publish/logs publish/logs
**/logs/

4
build/src/docker/publish/apps/be/Web.Gateway/Web.Gateway.deps.json

@ -6,7 +6,7 @@
"compilationOptions": {}, "compilationOptions": {},
"targets": { "targets": {
".NETCoreApp,Version=v6.0": { ".NETCoreApp,Version=v6.0": {
"Web.Gateway/0.1.1": { "Web.Gateway/0.1.5": {
"dependencies": { "dependencies": {
"Flurl": "3.0.7", "Flurl": "3.0.7",
"InfluxDB.Client": "4.11.0", "InfluxDB.Client": "4.11.0",
@ -480,7 +480,7 @@
} }
}, },
"libraries": { "libraries": {
"Web.Gateway/0.1.1": { "Web.Gateway/0.1.5": {
"type": "project", "type": "project",
"serviceable": false, "serviceable": false,
"sha512": "" "sha512": ""

BIN
build/src/docker/publish/apps/be/Web.Gateway/Web.Gateway.dll

Binary file not shown.

BIN
build/src/docker/publish/apps/be/Web.Gateway/Web.Gateway.exe

Binary file not shown.

BIN
build/src/docker/publish/apps/be/Web.Gateway/Web.Gateway.pdb

Binary file not shown.

2
build/src/docker/publish/apps/be/Web.Gateway/appsettings.Production.json

@ -0,0 +1,2 @@
{
}

34
build/src/docker/publish/apps/be/Web.Gateway/appsettings.json

@ -2,14 +2,38 @@
"ConnectionStrings": { "ConnectionStrings": {
"InfluxDB": "url=http://influxdb:8086;database=logs;usr=admin;pwd=aA123456!;retention-policy=d30;" "InfluxDB": "url=http://influxdb:8086;database=logs;usr=admin;pwd=aA123456!;retention-policy=d30;"
}, },
"CORS": {
"abp": {
"AllowAnyOrigin": false,
"Origins": [
"http://localhost:9527"
]
}
},
"ReverseProxy": { "ReverseProxy": {
"Routes": { "Routes": {
"abp": {
"ClusterId": "abp",
"CorsPolicy": "abp",
"Match": {
"Path": "/api/auth/{regex((abp|identity|base|multi-tenancy|permission-management))}/{**catch-all}"
},
"Transforms": [
{
"PathRemovePrefix": "/api/auth"
}
]
},
"ids4": { "ids4": {
"ClusterId": "ids4", "ClusterId": "auth",
"Match": { "Match": {
"Path": "/api/connect/{**catch-all}" "Path": "/api/auth/connect/{**catch-all}"
}, },
"Transforms": [ { "PathRemovePrefix": "/api" } ] "Transforms": [
{
"PathRemovePrefix": "/api/auth"
}
]
}, },
"auth": { "auth": {
"ClusterId": "auth", "ClusterId": "auth",
@ -37,10 +61,10 @@
} }
}, },
"Clusters": { "Clusters": {
"ids4": { "abp": {
"Destinations": { "Destinations": {
"dest": { "dest": {
"Address": "http://sfs-auth-web:59093/" "Address": "http://sfs-auth-web:59093/api/"
} }
} }
}, },

6824
build/src/docker/publish/apps/be/Web.Gateway/logs/log.txt

File diff suppressed because it is too large

9
build/src/docker/publish/conf/gateway/appsettings.json

@ -2,10 +2,19 @@
"ConnectionStrings": { "ConnectionStrings": {
"InfluxDB": "url=http://influxdb:8086;database=logs;usr=admin;pwd=aA123456!;retention-policy=d30;" "InfluxDB": "url=http://influxdb:8086;database=logs;usr=admin;pwd=aA123456!;retention-policy=d30;"
}, },
"CORS": {
"abp": {
"AllowAnyOrigin": false,
"Origins": [
"http://localhost:9527"
]
}
},
"ReverseProxy": { "ReverseProxy": {
"Routes": { "Routes": {
"abp": { "abp": {
"ClusterId": "abp", "ClusterId": "abp",
"CorsPolicy": "abp",
"Match": { "Match": {
"Path": "/api/auth/{regex((abp|identity|base|multi-tenancy|permission-management))}/{**catch-all}" "Path": "/api/auth/{regex((abp|identity|base|multi-tenancy|permission-management))}/{**catch-all}"
}, },

Loading…
Cancel
Save