Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Infrastructure/Controllers/BaseController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Infrastructure.Extensions;
using Infrastructure.Model;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MiniExcelLibs;
using Newtonsoft.Json;
Expand Down Expand Up @@ -71,7 +72,7 @@ protected IActionResult ExportExcel(string path, string fileName)
}
var stream = System.IO.File.OpenRead(path); //创建文件流

Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
Response.Headers.Append("Access-Control-Expose-Headers", "Content-Disposition");
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", HttpUtility.UrlEncode(fileName));
}

Expand All @@ -88,7 +89,7 @@ protected IActionResult DownFile(string path, string fileName)
return NotFound();
}
var stream = System.IO.File.OpenRead(path); //创建文件流
Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
Response.Headers.Append("Access-Control-Expose-Headers", "Content-Disposition");
return File(stream, "application/octet-stream", HttpUtility.UrlEncode(fileName));
}

Expand Down
5 changes: 3 additions & 2 deletions Infrastructure/Controllers/JsonApiController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Infrastructure.Extensions;
using Infrastructure.Model;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MiniExcelLibs;
using System;
Expand Down Expand Up @@ -75,7 +76,7 @@ protected IActionResult ExportExcel(string path, string fileName)
}
var stream = System.IO.File.OpenRead(path); //创建文件流

Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
Response.Headers.Append("Access-Control-Expose-Headers", "Content-Disposition");
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", HttpUtility.UrlEncode(fileName));
}

Expand All @@ -92,7 +93,7 @@ protected IActionResult DownFile(string path, string fileName)
return NotFound();
}
var stream = System.IO.File.OpenRead(path); //创建文件流
Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
Response.Headers.Append("Access-Control-Expose-Headers", "Content-Disposition");
return File(stream, "application/octet-stream", HttpUtility.UrlEncode(fileName));
}

Expand Down
3 changes: 2 additions & 1 deletion Infrastructure/WebExtensions/JwtExtension.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Infrastructure;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
using System;
Expand Down Expand Up @@ -27,7 +28,7 @@ public static void AddJwt(this IServiceCollection services)
if (context.Exception.GetType() == typeof(SecurityTokenExpiredException))
{
Console.WriteLine("jwt过期了");
context.Response.Headers.Add("Token-Expired", "true");
context.Response.Headers.Append("Token-Expired", "true");
}

return Task.CompletedTask;
Expand Down
10 changes: 6 additions & 4 deletions Infrastructure/ZR.Infrastructure.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>8632</NoWarn>
Expand All @@ -12,12 +12,14 @@

<ItemGroup>
<PackageReference Include="AspectCore.Abstractions" Version="2.4.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
<PackageReference Include="JinianNet.JNTemplate" Version="2.4.2" />
<PackageReference Include="MiniExcel" Version="1.32.1" />
<PackageReference Include="MiniExcel" Version="1.34.2" />
<PackageReference Include="CSRedisCore" Version="3.8.803" />
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
Expand Down
2 changes: 1 addition & 1 deletion ZR.Admin.WebApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
context.Request.EnableBuffering();
if (context.Request.Query.TryGetValue("access_token", out var token))
{
context.Request.Headers.Add("Authorization", $"Bearer {token}");
context.Request.Headers.Append("Authorization", $"Bearer {token}");
}
return next();
});
Expand Down
18 changes: 12 additions & 6 deletions ZR.Admin.WebApi/ZR.Admin.WebApi.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -17,13 +17,19 @@
<ProjectReference Include="..\ZR.Tasks\ZR.Tasks.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.7" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.12" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.11" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.9" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="MimeKit" Version="4.8.0" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.170" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.14" />
<PackageReference Include="Mapster" Version="7.4.0" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.8" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions ZR.CodeGenerator/ZR.CodeGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,7 +11,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="JinianNet.JNTemplate" Version="2.4.2" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.157" />
<PackageReference Include="MimeKit" Version="4.8.0" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.170" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
</Project>
12 changes: 8 additions & 4 deletions ZR.Common/ZR.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
<PackageReference Include="MailKit" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.19" />
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="MailKit" Version="4.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="MimeKit" Version="4.8.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions ZR.Model/ZR.Model.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1701;1702;1591;1570</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MiniExcel" Version="1.32.1" />
<PackageReference Include="MiniExcel" Version="1.34.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.157" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.170" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions ZR.Repository/ZR.Repository.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,6 +13,7 @@
<PackageReference Include="Mapster" Version="7.4.0" />
<PackageReference Include="MySqlConnector" Version="2.3.7" />
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.157" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.170" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
</Project>
9 changes: 8 additions & 1 deletion ZR.Service/ZR.Service.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="MimeKit" Version="4.8.0" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.170" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ZR.ServiceCore\ZR.ServiceCore.csproj" />
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions ZR.ServiceCore/Filters/VerifyAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Infrastructure;
using Infrastructure.Model;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
Expand Down Expand Up @@ -55,10 +56,10 @@ public void OnAuthorization(AuthorizationFilterContext context)
//移动端不加下面这个获取不到自定义Header
if (osType != null)
{
context.HttpContext.Response.Headers.Add("Access-Control-Expose-Headers", "X-Refresh-Token");
context.HttpContext.Response.Headers.Append("Access-Control-Expose-Headers", "X-Refresh-Token");
}
logger.Info($"刷新token,userName={loginUser.UserName},token={newToken}");
context.HttpContext.Response.Headers.Add("X-Refresh-Token", newToken);
context.HttpContext.Response.Headers.Append("X-Refresh-Token", newToken);
}
}
if (loginUser == null || !isAuthed)
Expand Down
9 changes: 7 additions & 2 deletions ZR.ServiceCore/ZR.ServiceCore.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1701;1702;1591;1570</NoWarn>
Expand All @@ -13,8 +13,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="MimeKit" Version="4.8.0" />
<PackageReference Include="NETCore.Encrypt" Version="2.1.1" />
<PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.170" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

</Project>
13 changes: 9 additions & 4 deletions ZR.Tasks/ZR.Tasks.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="Quartz" Version="3.9.0" />
<PackageReference Include="Quartz.Serialization.Json" Version="3.9.0" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="MimeKit" Version="4.8.0" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="Quartz" Version="3.13.1" />
<PackageReference Include="Quartz.Serialization.Json" Version="3.13.1" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.170" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down