mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-04-23 14:42:51 +08:00
perf: ⚡ 升级至.NET9 (#90)
This commit is contained in:
parent
6f89015198
commit
ad3eab929d
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -35,7 +35,7 @@ jobs:
|
|||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: 8.0.x
|
dotnet-version: 9.0.x
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.nuget/packages
|
path: ~/.nuget/packages
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<BaseIntermediateOutputPath>$(SolutionDir)/dist/backend/$(MSBuildProjectName)/obj</BaseIntermediateOutputPath>
|
<BaseIntermediateOutputPath>$(SolutionDir)/dist/backend/$(MSBuildProjectName)/obj</BaseIntermediateOutputPath>
|
||||||
<BaseOutputPath>$(SolutionDir)/dist/backend/$(MSBuildProjectName)/bin</BaseOutputPath>
|
<BaseOutputPath>$(SolutionDir)/dist/backend/$(MSBuildProjectName)/bin</BaseOutputPath>
|
||||||
<Copyright>© 2006-2023 nsnail</Copyright>
|
<Copyright>© 2006-2023 nsnail</Copyright>
|
||||||
<Description>通用后台权限管理系统、快速开发框架(基于C#12/.NET8、Vue3/Vite、Element Plus等现代技术构建,具有十分整洁、优雅的编码规范)</Description>
|
<Description>通用后台权限管理系统、快速开发框架(基于C#12/.NET9、Vue3/Vite、Element Plus等现代技术构建,具有十分整洁、优雅的编码规范)</Description>
|
||||||
<EnableBaseIntermediateOutputPathMismatchWarning>false</EnableBaseIntermediateOutputPathMismatchWarning>
|
<EnableBaseIntermediateOutputPathMismatchWarning>false</EnableBaseIntermediateOutputPathMismatchWarning>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<Product>NetAdmin</Product>
|
<Product>NetAdmin</Product>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>https://github.com/nsnail/NetAdmin.git</RepositoryUrl>
|
<RepositoryUrl>https://github.com/nsnail/NetAdmin.git</RepositoryUrl>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Title>$(AssemblyName)</Title>
|
<Title>$(AssemblyName)</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0.1 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0-preview.1 AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
RUN apt update
|
RUN apt update
|
||||||
RUN apt install -y redis
|
RUN apt install -y redis
|
||||||
COPY ./dist/backend/NetAdmin.BizServer.Host/bin/Release/net8.0/publish .
|
COPY ./dist/backend/NetAdmin.BizServer.Host/bin/Release/net9.0/publish .
|
||||||
ENTRYPOINT redis-server --daemonize yes && dotnet NetAdmin.BizServer.Host.dll -is
|
ENTRYPOINT redis-server --daemonize yes && dotnet NetAdmin.BizServer.Host.dll -is
|
@ -1,6 +1,6 @@
|
|||||||
# NetAdmin
|
# NetAdmin
|
||||||
|
|
||||||
通用后台权限管理系统、快速开发框架(基于C#12/.NET8、Vue3/Vite、Element Plus等现代技术构建,具有十分整洁、优雅的编码规范)
|
通用后台权限管理系统、快速开发框架(基于C#12/.NET9~~~~、Vue3/Vite、Element Plus等现代技术构建,具有十分整洁、优雅的编码规范)
|
||||||
|
|
||||||
[](https://github.com/nsnail/NetAdmin/actions/workflows/ci.yml)
|
[](https://github.com/nsnail/NetAdmin/actions/workflows/ci.yml)
|
||||||
[](https://github.com/nsnail/NetAdmin/blob/main/LICENSE)
|
[](https://github.com/nsnail/NetAdmin/blob/main/LICENSE)
|
||||||
@ -20,7 +20,7 @@ docker run -p 8080:8080 nsnail/netadmin
|
|||||||
## 构建步骤
|
## 构建步骤
|
||||||
|
|
||||||
- 后端
|
- 后端
|
||||||
1. 检查dotnet-sdk版本>=8.0.0
|
1. 检查dotnet-sdk版本>=9.0.0
|
||||||
``` shell
|
``` shell
|
||||||
dotnet --list-sdks
|
dotnet --list-sdks
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"Content": "<p>尊敬的用户:</p>\n<p style=\"padding-left: 40px;\">欢迎您使用 NetAdmin 后台管理系统!NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#12/.NET8、Vue3/Vite、Element Plus 等现代技术构建,具有十分整洁、优雅的编码规范。</p>\n<p style=\"padding-left: 40px;\">NetAdmin 致力于为企业提供高效、安全、易用的解决方案,帮助您快速构建出符合业务需求的应用程序。系统提供了丰富的功能模块,包括用户管理、权限管理、日志管理、文件上传等,可以满足您日常管理的需求。</p>\n<p style=\"padding-left: 40px;\">在使用 NetAdmin 的过程中,我们真诚地希望您能够遵守以下规定:</p>\n<p style=\"padding-left: 80px;\">1. 不得利用 NetAdmin 进行非法活动或者侵犯他人权益;</p>\n<p style=\"padding-left: 80px;\">2. 不得对 NetAdmin 系统进行恶意攻击或者破坏;</p>\n<p style=\"padding-left: 80px;\">3. 不得将 NetAdmin 系统的任何部分用于商业目的或者未经授权的访问。</p>\n<p style=\"padding-left: 80px;\">4. 为了更好地为您提供服务,NetAdmin 将不断进行优化和升级,同时也欢迎您提出宝贵的意见和建议。如果您在使用过程中遇到任何问题,可以通过官方网站或者技术支持团队进行咨询和解决。</p>\n<p style=\"padding-left: 40px;\">再次感谢您对 NetAdmin 的信任和支持!我们相信,在您的使用过程中,NetAdmin 一定会成为您的得力助手,为您的事业发展提供强有力的支持!</p>\n<p style=\"text-align: right;\">NetAdmin 开发团队</p>",
|
"Content": "<p>尊敬的用户:</p>\n<p style=\"padding-left: 40px;\">欢迎您使用 NetAdmin 后台管理系统!NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#12/.NET9、Vue3/Vite、Element Plus 等现代技术构建,具有十分整洁、优雅的编码规范。</p>\n<p style=\"padding-left: 40px;\">NetAdmin 致力于为企业提供高效、安全、易用的解决方案,帮助您快速构建出符合业务需求的应用程序。系统提供了丰富的功能模块,包括用户管理、权限管理、日志管理、文件上传等,可以满足您日常管理的需求。</p>\n<p style=\"padding-left: 40px;\">在使用 NetAdmin 的过程中,我们真诚地希望您能够遵守以下规定:</p>\n<p style=\"padding-left: 80px;\">1. 不得利用 NetAdmin 进行非法活动或者侵犯他人权益;</p>\n<p style=\"padding-left: 80px;\">2. 不得对 NetAdmin 系统进行恶意攻击或者破坏;</p>\n<p style=\"padding-left: 80px;\">3. 不得将 NetAdmin 系统的任何部分用于商业目的或者未经授权的访问。</p>\n<p style=\"padding-left: 80px;\">4. 为了更好地为您提供服务,NetAdmin 将不断进行优化和升级,同时也欢迎您提出宝贵的意见和建议。如果您在使用过程中遇到任何问题,可以通过官方网站或者技术支持团队进行咨询和解决。</p>\n<p style=\"padding-left: 40px;\">再次感谢您对 NetAdmin 的信任和支持!我们相信,在您的使用过程中,NetAdmin 一定会成为您的得力助手,为您的事业发展提供强有力的支持!</p>\n<p style=\"text-align: right;\">NetAdmin 开发团队</p>",
|
||||||
"CreatedUserId": 370942943322181,
|
"CreatedUserId": 370942943322181,
|
||||||
"CreatedUserName": "root",
|
"CreatedUserName": "root",
|
||||||
"MsgType": 2,
|
"MsgType": 2,
|
||||||
"Summary": "尊敬的用户:\n欢迎您使用 NetAdmin 后台管理系统!NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#12/.NET8、Vue3/Vite、Element Plus 等现代",
|
"Summary": "尊敬的用户:\n欢迎您使用 NetAdmin 后台管理系统!NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#12/.NET9、Vue3/Vite、Element Plus 等现代",
|
||||||
"Title": "欢迎使用 NetAdmin 后台管理系统",
|
"Title": "欢迎使用 NetAdmin 后台管理系统",
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -19,7 +19,7 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Roslynator.Analyzers" Version="4.10.0">
|
<PackageReference Include="Roslynator.Analyzers" Version="4.11.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"sdk": {
|
"sdk": {
|
||||||
"version": "8.0.0",
|
"version": "9.0.0",
|
||||||
"rollForward": "latestMajor",
|
"rollForward": "latestMajor",
|
||||||
"allowPrerelease": true
|
"allowPrerelease": true
|
||||||
},
|
},
|
||||||
"tools": {
|
"tools": {
|
||||||
"dotnet": "8.0.0"
|
"dotnet": "9.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,7 +9,7 @@
|
|||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"packageName": "Furion.Pure.NS",
|
"packageName": "Furion.Pure.NS",
|
||||||
"version": "4.9.1.24-ns1"
|
"version": "4.9.1.31-ns2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@ public static class ServiceCollectionExtensions
|
|||||||
private static void MarkupLine( //
|
private static void MarkupLine( //
|
||||||
string msg //
|
string msg //
|
||||||
, LogMessage message //
|
, LogMessage message //
|
||||||
, IReadOnlyDictionary<LogLevels, DisplayAttribute> logLevels)
|
, Dictionary<LogLevels, DisplayAttribute> logLevels)
|
||||||
{
|
{
|
||||||
// 日志过长
|
// 日志过长
|
||||||
if (msg.Length > Numbers.CONSOLE_LINE_LEN_LIMIT) {
|
if (msg.Length > Numbers.CONSOLE_LINE_LEN_LIMIT) {
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
<PackageReference Include="Cronos" Version="0.8.3"/>
|
<PackageReference Include="Cronos" Version="0.8.3"/>
|
||||||
<PackageReference Include="FreeSql.DbContext.NS" Version="3.2.810-preview20231229-ns1"/>
|
<PackageReference Include="FreeSql.DbContext.NS" Version="3.2.810-preview20231229-ns1"/>
|
||||||
<PackageReference Include="FreeSql.Provider.Sqlite.NS" Version="3.2.810-preview20231229-ns1"/>
|
<PackageReference Include="FreeSql.Provider.Sqlite.NS" Version="3.2.810-preview20231229-ns1"/>
|
||||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.1.24"/>
|
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.1.31"/>
|
||||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster.NS" Version="4.9.1.24-ns1"/>
|
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster.NS" Version="4.9.1.31-ns2"/>
|
||||||
<PackageReference Include="Furion.Pure.NS" Version="4.9.1.24-ns1"/>
|
<PackageReference Include="Furion.Pure.NS" Version="4.9.1.31-ns2"/>
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.1"/>
|
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0-preview.1.24081.5"/>
|
||||||
<PackageReference Include="Minio" Version="6.0.2"/>
|
<PackageReference Include="Minio" Version="6.0.2"/>
|
||||||
<PackageReference Include="NSExt" Version="2.0.11"/>
|
<PackageReference Include="NSExt" Version="2.0.11"/>
|
||||||
<PackageReference Include="RedLock.net" Version="2.3.2"/>
|
<PackageReference Include="RedLock.net" Version="2.3.2"/>
|
||||||
|
@ -2,7 +2,6 @@ using NetAdmin.Application.Repositories;
|
|||||||
using NetAdmin.Application.Services;
|
using NetAdmin.Application.Services;
|
||||||
using NetAdmin.Domain.Attributes.DataValidation;
|
using NetAdmin.Domain.Attributes.DataValidation;
|
||||||
using NetAdmin.Domain.Contexts;
|
using NetAdmin.Domain.Contexts;
|
||||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
|
||||||
using NetAdmin.Domain.DbMaps.Sys;
|
using NetAdmin.Domain.DbMaps.Sys;
|
||||||
using NetAdmin.Domain.Dto.Dependency;
|
using NetAdmin.Domain.Dto.Dependency;
|
||||||
using NetAdmin.Domain.Dto.Sys.User;
|
using NetAdmin.Domain.Dto.Sys.User;
|
||||||
@ -429,7 +428,7 @@ public sealed class UserService(
|
|||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static LoginRsp LoginInternal(IFieldEnabled dbUser)
|
private static LoginRsp LoginInternal(Sys_User dbUser)
|
||||||
{
|
{
|
||||||
if (!dbUser.Enabled) {
|
if (!dbUser.Enabled) {
|
||||||
throw new NetAdminInvalidOperationException(Ln.请联系管理员激活账号);
|
throw new NetAdminInvalidOperationException(Ln.请联系管理员激活账号);
|
||||||
|
@ -2,7 +2,6 @@ using FreeSql.Internal;
|
|||||||
using Furion.RemoteRequest;
|
using Furion.RemoteRequest;
|
||||||
using Furion.RemoteRequest.Extensions;
|
using Furion.RemoteRequest.Extensions;
|
||||||
using Furion.Schedule;
|
using Furion.Schedule;
|
||||||
using NetAdmin.Domain.DbMaps.Sys;
|
|
||||||
using NetAdmin.Domain.Dto.Sys.Job;
|
using NetAdmin.Domain.Dto.Sys.Job;
|
||||||
using NetAdmin.Domain.Dto.Sys.JobRecord;
|
using NetAdmin.Domain.Dto.Sys.JobRecord;
|
||||||
using NetAdmin.Host.BackgroundRunning;
|
using NetAdmin.Host.BackgroundRunning;
|
||||||
@ -104,7 +103,7 @@ public sealed class ScheduledJob : WorkBase<ScheduledJob>, IJob
|
|||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private HttpRequestPart BuildRequest(Sys_Job job)
|
private HttpRequestPart BuildRequest(QueryJobRsp job)
|
||||||
{
|
{
|
||||||
var ret = job.RequestUrl.SetHttpMethod(new HttpMethod(job.HttpMethod.ToString()));
|
var ret = job.RequestUrl.SetHttpMethod(new HttpMethod(job.HttpMethod.ToString()));
|
||||||
var headers = new Dictionary<string, string>();
|
var headers = new Dictionary<string, string>();
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit" Version="2.7.0"/>
|
<PackageReference Include="xunit" Version="2.7.0"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.1"/>
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0-preview.1.24081.5"/>
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user