chore(core): 降级项目目标框架及相关依赖至 net9.0

- 统一将 COMCMS.API、COMCMS.Common、COMCMS.Core、COMCMS.Web 和 Lib.Core 项目的目标框架从 net10.0 降级至 net9.0
- 调整 COMCMS.Web 项目中部分 NuGet 包版本号以匹配 net9.0 版本要求
- 更新 Dockerfile 中的基础镜像版本为 .NET 9.0,保持构建和运行环境一致
- 修改 appsettings.json 中数据库服务器地址为 localhost,优化本地连接配置
- 删除敏感信息的 .env 文件,新增示例环境变量文件 .env.example,便于开发者配置环境变量
- 在 .gitignore 中添加 .env 文件,防止敏感信息被提交到代码仓库
This commit is contained in:
jonah.fu
2025-12-06 20:27:11 +08:00
parent 1cdabd1ee7
commit 3be384a668
10 changed files with 38 additions and 26 deletions
+4 -4
View File
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="4.14.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.0" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="10.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="MimeKit" Version="4.14.0" />
+2 -2
View File
@@ -1,7 +1,7 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
# 构建阶段
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# 复制项目文件
@@ -27,7 +27,7 @@ FROM build AS publish
RUN dotnet publish "COMCMS.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false
# 运行时阶段
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
# 安装 curl 用于健康检查
USER root
+1 -1
View File
@@ -38,7 +38,7 @@
},
"connectionStrings": {
"dbconn": {
"connectionString": "Server=.;Port=3306;Database=comcms;Uid=root;Pwd=root;charset=utf8mb4",
"connectionString": "Server=localhost;Port=3306;Database=comcms;Uid=root;Pwd=root;charset=utf8mb4",
"providerName": "MySql.Data.MySqlClient"
},
"mssqlconnon": {