From 1aabc495212f8a3261fbf73254dd3ebfd77c5232 Mon Sep 17 00:00:00 2001 From: Grand-cocoa <1075576561@qq.com49111108+grand-cocoa@users.noreply.github.com> Date: Wed, 12 Nov 2025 15:45:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor(config):=20=E5=B0=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90=E9=85=8D=E7=BD=AE=E7=A7=BB=E8=87=B3=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E7=89=B9=E5=AE=9A=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 从 application.yml 中移除数据源配置 - 在 application-dev.yml 中添加开发环境数据源配置 - 在 application-prod.yml 中添加生产环境数据源配置 - 保持 MyBatis-Plus 配置不变 - 确保不同环境使用正确的数据库连接信息 --- src/main/resources/application-dev.yml | 5 +++++ src/main/resources/application-prod.yml | 5 +++++ src/main/resources/application.yml | 3 --- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 7be8ffd..c9938b1 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1,3 +1,8 @@ +spring: + datasource: + url: jdbc:mysql://localhost:3306/animo?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false + username: animo + password: WS6PCwksRpEYNpNt passkey: id: "localhost" name: "Animo" diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 87921b8..55de69d 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -1,3 +1,8 @@ +spring: + datasource: + url: jdbc:mysql://10.0.16.3:3306/animo?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false + username: animo + password: WS6PCwksRpEYNpNt passkey: id: "animo.alina-dace.info" name: "Animo" diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index a05bef8..a8581ea 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -9,9 +9,6 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/animo?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false - username: animo - password: WS6PCwksRpEYNpNt mybatis-plus: mapper-locations: classpath*:/mapper/**/*.xml