diff --git a/IRaCIS.Core.API/Controllers/Common/FileController.cs b/IRaCIS.Core.API/Controllers/Common/FileController.cs index 6f8398b..21af293 100644 --- a/IRaCIS.Core.API/Controllers/Common/FileController.cs +++ b/IRaCIS.Core.API/Controllers/Common/FileController.cs @@ -50,7 +50,7 @@ namespace IRaCIS.Api.Controllers _hostEnvironment = hostEnvironment; _webHostEnvironment = webHostEnvironment; _fileSizeLimit = config.GetValue("FileSizeLimit"); - defaultUploadFilePath = Directory.GetParent(_hostEnvironment.ContentRootPath).FullName; + defaultUploadFilePath = Path.GetFullPath(Path.Combine(webHostEnvironment.ContentRootPath, "..")); _logger = logger; _logger.LogError("File Path:"+ defaultUploadFilePath); diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.csproj b/IRaCIS.Core.API/IRaCIS.Core.API.csproj index 36bc645..e005953 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.csproj +++ b/IRaCIS.Core.API/IRaCIS.Core.API.csproj @@ -71,7 +71,7 @@ - + PreserveNewest diff --git a/IRaCIS.Core.API/NLog.config b/IRaCIS.Core.API/NLog.config index 9f00f0e..5176cee 100644 --- a/IRaCIS.Core.API/NLog.config +++ b/IRaCIS.Core.API/NLog.config @@ -4,7 +4,7 @@ xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd" autoReload="true" throwExceptions="true" - internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log"> + internalLogLevel="Off" > { - // 忽略循环引用 + // 蹇界暐寰幆寮曠敤 options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - // 不使用驼峰 + // 涓嶄娇鐢ㄩ┘宄 options.SerializerSettings.ContractResolver = new NullToEmptyStringResolver(); //new DefaultContractResolver();// new NullToEmptyStringResolver(); - // 设置时间格式 + // 璁剧疆鏃堕棿鏍煎紡 options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; }); @@ -118,7 +121,7 @@ namespace IRaCIS.Core.API { if (env.IsDevelopment()) { - ////不能放在静态方法中 + ////涓嶈兘鏀惧湪闈欐佹柟娉曚腑 //app.UseSwaggerUI(options => //{ // options.IndexStream = () => @@ -132,12 +135,15 @@ namespace IRaCIS.Core.API app.UseStaticFiles(); - //app.UseStaticFiles(new StaticFileOptions() - //{ - // FileProvider = new PhysicalFileProvider( - // Path.Combine(Directory.GetCurrentDirectory(), @"UploadFile")), - // RequestPath = new PathString("/UploadFile") - //}); + app.UseStaticFiles(new StaticFileOptions() + { + FileProvider = new PhysicalFileProvider( + Path.Combine(Path.GetFullPath(Path.Combine(env.ContentRootPath, "..")), @"UploadFile")), + RequestPath = new PathString("/UploadFile"), + ServeUnknownFileTypes = true, + DefaultContentType = "application/octet-stream" + + }); //app.UseMiddleware(); diff --git a/IRaCIS.Core.API/appsettings.json b/IRaCIS.Core.API/appsettings.json index 7ca937d..776ab19 100644 --- a/IRaCIS.Core.API/appsettings.json +++ b/IRaCIS.Core.API/appsettings.json @@ -1,9 +1,7 @@ { "ConnectionStrings": { - // "RemoteNew": "Server=101.132.193.237,1434;Database=IRaCIS_History_Cost;User ID=sa;Password=zhanying@2021;", --姝e紡 - "RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_P;User ID=sa;Password=dev123456DEV;", + "RemoteNew": "Server=192.168.3.68,1434;Database=IRaCIS_B;User ID=sa;Password=xc@123456;", "hang": "Server=ZHOU;Database=IRaCIS;User ID=sa;Password=sa123456;" - //"RemoteTest": "Server=123.56.181.144,14333\\MSSQLExpress14;Database=IRaCIS_B;User ID=sa;Password=dev123456DEV;" }, "Logging": { "IncludeScopes": false, @@ -15,20 +13,20 @@ }, "AllowedHosts": "*", "JwtSetting": { - "SecurityKey": "3e6dbfa227234a03977a2f421bdb7f4f", // 锟斤拷钥 - "Issuer": "jwtIssuertest1", // 锟戒发锟斤拷 - "Audience": "jwtAudiencetest1", // 锟斤拷锟斤拷锟斤拷 - "TokenExpireDays": "7" // 锟斤拷锟斤拷时锟戒(7day锟斤拷 + "SecurityKey": "3e6dbfa227234a03977a2f421bdb7f4f", + "Issuer": "jwtIssuertest1", + "Audience": "jwtAudiencetest1", + "TokenExpireDays": "7" }, - "RootUrl": "http://123.56.181.144:8000", + "RootUrl": "http://192.168.3.68:9030", "CodePrefix": "RE", "UserCodePrefix": "U", "VisitPlanNumPrefix": "VT", - "StoredFilesPath": "D:\\Upload", //锟矫节碉拷没锟矫碉拷 - "DicomFileArchivedPath": "D:\\Upload", // + "StoredFilesPath": "D:\\Upload", + "DicomFileArchivedPath": "D:\\Upload", "Share": false, // "FileSizeLimit": 1073741824, - "LoginExpiredTimeSpan": "锟斤拷15", // Minute + "LoginExpiredTimeSpan": "15", // Minute "OpenLog": true, "AddClinicalInfo": true, "easycaching": {