From 83ce9fb4c46d15d793da6ad56812348a0940d363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Mon, 26 Sep 2022 00:27:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E7=BD=B2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Yi.Framework.ApiMicroservice/Program.cs | 3 +- .../Yi.Framework.ApiMicroservice.csproj | 9 +++ .../appsettings.Production.json | 75 ++++++++++--------- .../MiddlewareExtend/SwaggerExtension.cs | 2 +- 4 files changed, 50 insertions(+), 39 deletions(-) diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs index 88c1f81e..acc28b90 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs @@ -127,7 +127,8 @@ builder.Services.AddSignalR(); builder.Services.AddHeiCaptcha(); #region //Http -#endregion +#endregionv + builder.Services.AddHttpContextAccessor(); //----------------------------------------------------------------------------------------------------------- var app = builder.Build(); diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Yi.Framework.ApiMicroservice.csproj b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Yi.Framework.ApiMicroservice.csproj index 2569ac4b..5858bda3 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Yi.Framework.ApiMicroservice.csproj +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Yi.Framework.ApiMicroservice.csproj @@ -30,6 +30,15 @@ + + Always + + + Always + + + Always + Always diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Production.json b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Production.json index a57d0d34..37d54a8b 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Production.json +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Production.json @@ -1,5 +1,5 @@ { - "StartUrl": "http://*:19001", + "StartUrl": "http://localohost:19001", "Logging": { "LogLevel": { "Default": "Information", @@ -10,12 +10,10 @@ "AllowedHosts": "*", "Consul_Enabled": false, - "DbSeed_Enabled": false, "Apollo_Enabled": false, "HealthCheck_Enabled": false, "RabbitMQ_Enabled": false, "Redis_Enabled": false, - "RedisSeed_Enabled": false, "Kafka_Enabled": false, "ElasticSeach_Enabled": false, "MutiDB_Enabled": false, @@ -23,57 +21,60 @@ "CAP_Enabled": false, "CAPDashboard_Enabled": false, + "DbSeed_Enabled": true, + "RedisSeed_Enabled": false, + "Cors_Enabled": true, "DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ], - "DbSelect": "Mysql", - "Pan": { - "ZipPath": "D:/AppWeb/test/zip" - }, - + "DbSelect": "Sqlite", "DbConn": { - //"WriteUrl": "DataSource=yi-sqlsugar-dev.db", - "WriteUrl": "server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]", + "WriteUrl": "DataSource=yi-sqlsugar-dev.db", + //"WriteUrl": "server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.", "ReadUrl": [ - "server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]", - "server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]", - "server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]" + "server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.", + "server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.", + "server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020." ] }, - "JWTTokenOptions": { - "Audience": "http://localhost:7000", - "Issuer": "http://localhost:7000", - "SecurityKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI2a2EJ7m872v0afyoSDJT2o1+SitIeJSWtLJU8/Wz2m7gStexajkeD+Lka6DSTy8gt9UwfgVQo6uKjVLG5Ex7PiGOODVqAEghBuS7JzIYU5RvI543nNDAPfnJsas96mSA7L/mD7RTE2drj6hf3oZjJpMPZUQI/B1Qjb5H3K3PNwIDAQAB" + "JwtAuthorize": { + "Issuer": "cc", + "Audience": "cc", + "PolicyName": "permission", + "DefaultScheme": "Bearer", + "IsHttps": false, + "Expiration": 30, + "ReExpiration": 3000 }, "RedisConnOptions": { - "Host": "[xxxx]", + "Host": "118.195.191.41", "Prot": 6379, "DB": 1, - "Password": "[xxxx]" + "Password": "Qz52013142020." }, "RabbitConn": { - "HostName": "[xxxx]", - "UserName": "[xxxx]", - "Password": "[xxxx]", + "HostName": "118.195.191.41", + "UserName": "cc", + "Password": "cc", "Port": 5672 }, "ElasticSeachConn": { - "Url": "[xxxx]", - "IndexName": "[xxxx]", - "UserName": "[xxxx]", - "PassWord": "[xxxx]" + "Url": "https://es-4zakkyyn.public.tencentelasticsearch.com:9200", + "IndexName": "yies", + "UserName": "elastic", + "PassWord": "Qz52013142020." }, "KafkaOptions": { - "BrokerList": "[xxxx]", - "TopicName": "[xxxx]" + "BrokerList": "192.168.3.230:9092", + "TopicName": "kafkalog" }, "ConsulClientOption": { - "IP": "[xxxx]", - "Port": "[xxxx]", - "Datacenter": "[xxxx]" + "IP": "118.195.191.41", + "Port": "8500", + "Datacenter": "dc1" }, "ConsulRegisterOption": { - "IP": "[xxxx]", - "Port": "19001", + "IP": "118.195.191.41", + "Port": "19005", "GroupName": "ApiMicroservice", "HealthCheckUrl": "/Health", "Interval": 10, @@ -82,10 +83,10 @@ "Tag": "13" }, "SMS": { - "ID": "[xxxx]", - "Secret": "[xxxx]", - "Sign": "[xxxx]", - "Template": "[xxxx]" + "ID": "LTAI5tJvjPaXCyyPMfXLNbVA", + "Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn", + "Sign": "JiftCC", + "Template": "SMS_221640732" }, "IPLibraryServiceUrl": "http://gRPCIPLibraryService" } \ No newline at end of file diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/SwaggerExtension.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/SwaggerExtension.cs index 05c0e032..1c4bca99 100644 --- a/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/SwaggerExtension.cs +++ b/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/SwaggerExtension.cs @@ -31,7 +31,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend //为 Swagger JSON and UI设置xml文档注释路径 //获取应用程序所在目录(绝对路径,不受工作目录影响,建议采用此方法获取路径使用windwos&Linux) var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); - var apiXmlPath = Path.Combine(basePath, @"SwaggerDoc.xml");//控制器层注释 + var apiXmlPath = Path.Combine(basePath, @"Config/SwaggerDoc.xml");//控制器层注释 //var entityXmlPath = Path.Combine(basePath, @"SwaggerDoc.xml");//实体注释 //c.IncludeXmlComments(apiXmlPath, true);//true表示显示控制器注释 c.IncludeXmlComments(apiXmlPath, true);