From fe3fbbe1357b1ef1d17a361bedef8ad143edf3b5 Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 2 Dec 2025 10:21:07 +0800 Subject: [PATCH 01/12] =?UTF-8?q?DEV=20=E5=88=87=E6=8D=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/config/MyTaskScheduler.java | 2 +- src/main/java/com/ai/da/common/task/PaymentTask.java | 4 ++-- src/main/resources/application-dev.properties | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 4330552c..433bdd11 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -202,7 +202,7 @@ public class MyTaskScheduler { } } - @Scheduled(cron = "0 0 9 * * ?") +// @Scheduled(cron = "0 0 9 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1); diff --git a/src/main/java/com/ai/da/common/task/PaymentTask.java b/src/main/java/com/ai/da/common/task/PaymentTask.java index 0ead7b54..0e5efb03 100644 --- a/src/main/java/com/ai/da/common/task/PaymentTask.java +++ b/src/main/java/com/ai/da/common/task/PaymentTask.java @@ -45,7 +45,7 @@ public class PaymentTask { @Resource private PayPalCheckoutService payPalCheckoutService; - @Scheduled(cron = "0/30 * * * * ?") +// @Scheduled(cron = "0/30 * * * * ?") public void orderConfirmForPaypal() throws SerializeException { // log.info("PayPal orderConfirm 被执行......"); @@ -122,7 +122,7 @@ public class PaymentTask { @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes public void calcCouponsCommission(){ - log.info("优惠券佣金计算定时器"); +// log.info("优惠券佣金计算定时器"); affiliateService.calcCouponsCommission(); } diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 9b0798ad..74b511b6 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,8 +1,8 @@ server.port=5567 spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver -#spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true -spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida_back?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +#spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida_back?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true #spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/test_aida_3.1?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true spring.datasource.primary.username=aida_con spring.datasource.primary.password=123456 From 2ec9ef329009e339237a29015f87e293e6538e18 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 2 Dec 2025 10:49:14 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=87=B3=E3=80=8C.gitea/workflows=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/develop_build_manual.yaml | 168 +++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 .gitea/workflows/develop_build_manual.yaml diff --git a/.gitea/workflows/develop_build_manual.yaml b/.gitea/workflows/develop_build_manual.yaml new file mode 100644 index 00000000..728e3e47 --- /dev/null +++ b/.gitea/workflows/develop_build_manual.yaml @@ -0,0 +1,168 @@ +name: 手动 AiDA back-java 开发分支构建部署 +on: + workflow_dispatch: + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + outputs: + build_status: ${{ job.status }} + build_url: ${{ gitea.server_url }}/${{ gitea.repository.owner.name }}/${{ gitea.repository.name }}/actions/runs/${{ gitea.run_id }} + + permissions: + contents: read + packages: write + + env: + REMOTE_DEPLOY_PATH: /workspace/workspace_aida/DevelopVersion/develop-version-aida-back + + steps: + - name: 0.记录开始时间 + id: build_start_time + run: echo "current_time=$(TZ='Asia/Hong_Kong' date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT + + - name: 1.检出代码 + uses: actions/checkout@v4 + with: + ref: dev/3.1_release_merge + + - name: 2.Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + + - name: 3.设置JAVA Maven 环境 + run: | + # 适配root/普通用户 + SUDO="" + [ "$(id -u)" != "0" ] && SUDO="sudo" + + # 安装依赖 + $SUDO apt update && $SUDO apt install -y wget tar --no-install-recommends + + # 下载Maven + MAVEN_VERSION="3.9.11" + MAVEN_TAR="apache-maven-${MAVEN_VERSION}-bin.tar.gz" + MAVEN_URL="https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/${MAVEN_TAR}" + wget --no-verbose -O /tmp/${MAVEN_TAR} ${MAVEN_URL} + + # 解压+软链接 + $SUDO tar -xzf /tmp/${MAVEN_TAR} -C /usr/local/ + $SUDO ln -sf /usr/local/apache-maven-${MAVEN_VERSION} /usr/local/maven + + # 配置PATH + echo "/usr/local/maven/bin" >> $GITHUB_PATH + export PATH="/usr/local/maven/bin:$PATH" + + # 验证 + mvn -v + + - name: 4.构建jar包 + run: | + echo "===== 开始构建JAR包 =====" + mvn -B clean package -DskipTests --file pom.xml 2>&1 + # 检查构建是否成功 + if [ $? -ne 0 ]; then + echo "JAR包构建失败!" + exit 1 + fi + + - name: 5.生成Dockerfile + run: | + echo "===== 生成Dockerfile =====" + cat > Dockerfile << 'EOF' + FROM openjdk:8 + VOLUME /tmp + RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + RUN echo 'Asia/Shanghai' > /etc/timezone + ADD ./target/aida-0.0.1-SNAPSHOT.jar /app.jar + ENTRYPOINT ["java","-jar","/app.jar"] + echo "Dockerfile内容:" + cat Dockerfile + + - name: 6.生成docker-compose.yml + run: | + echo "===== 生成docker-compose.yml =====" + cat > docker-compose.yml << 'EOF' + version: '3' + services: + aida_back: + container_name: develop-version-aida-back + build: . + volumes: + # 数据挂载 + - ./log:/log + ports: + - '10090:5567' + restart: always + EOF + # 验证docker-compose.yml生成 + echo "docker-compose.yml内容:" + cat docker-compose.yml + + - name: 7.安装SSH工具 + run: | + $SUDO apt install -y sshpass openssh-client --no-install-recommends + # 配置SSH免密 + mkdir -p ~/.ssh + echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts + + - name: 8.同步文件到远程服务器 + run: | + echo "===== 同步文件到远程服务器 =====" + # 使用scp同步文件 + scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + ./target/*.jar ./Dockerfile ./docker-compose.yml \ + ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }}:${{ env.REMOTE_DEPLOY_PATH }} 2>&1 + + - name: 9.部署和运行服务 + run: | + echo "===== 开始部署服务 =====" + # SSH执行部署命令 + ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << 'EOF_SSH' + cd ${{ env.REMOTE_DEPLOY_PATH }} + echo "停止旧容器..." + docker compose down || true + echo "清理Docker资源..." + docker system prune -f + echo "构建镜像..." + docker compose build --no-cache + echo "启动服务..." + docker compose up -d + echo "验证容器状态..." + docker compose ps + echo "部署完成!" + EOF_SSH + + - name: 10.发送构建结果邮件 + if: always() # 无论上一步是否失败,都执行此步骤 + uses: dawidd6/action-send-mail@v3 + with: + + from: ${{ secrets.MAIL_USERNAME }} + # --- 邮件配置 --- + server_address: smtp.gmail.com # 替换为你的SMTP服务器地址 + server_port: 465 # 替换为你的SMTP端口 (通常是465或587) + username: ${{ secrets.MAIL_USERNAME }} # 存储在Secrets中的邮箱用户名 + password: ${{ secrets.MAIL_PASSWORD }} # 存储在Secrets中的邮箱密码 + subject: 'Gitea Actions 构建通知: ${{ job.status }} - AiDA back-java Develop' + # 收件人列表,可以根据需要更改 + to: 'xupei3360@163.com,txli@aidlab.hk,cgzhou@aidlab.hk,zchengrong@yeah.net' # 替换为实际收件人邮箱 + + # --- 邮件正文内容 --- + body: | + 项目: AiDA back-java Develop + 分支: dev/3.1_release_merge + + 🎉 构建结果: ${{ job.status }} + + 📅 构建时间: ${{ steps.build_start_time.outputs.current_time }} + + 🔗 构建链接: ${{ gitea.server_url }}/${{ gitea.repository.owner.name }}/${{ gitea.repository.name }}/actions/runs/${{ gitea.run_id }} + + # 确保邮件内容为纯文本,或者你可以设置为 html: true 并调整 body + content_type: text/plain \ No newline at end of file From 3b5b57ab08047235110adfda806f30321220cb6b Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 2 Dec 2025 10:55:21 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?elop=5Fbuild=5Fmanual.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/develop_build_manual.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/develop_build_manual.yaml b/.gitea/workflows/develop_build_manual.yaml index 728e3e47..142fa42f 100644 --- a/.gitea/workflows/develop_build_manual.yaml +++ b/.gitea/workflows/develop_build_manual.yaml @@ -72,7 +72,7 @@ jobs: run: | echo "===== 生成Dockerfile =====" cat > Dockerfile << 'EOF' - FROM openjdk:8 + FROM openjdk:21 VOLUME /tmp RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone From 41ef9132e91444fbfae59738b66c410de1ed6a5e Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 2 Dec 2025 11:05:42 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?elop=5Fbuild=5Fmanual.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/develop_build_manual.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitea/workflows/develop_build_manual.yaml b/.gitea/workflows/develop_build_manual.yaml index 142fa42f..1a755802 100644 --- a/.gitea/workflows/develop_build_manual.yaml +++ b/.gitea/workflows/develop_build_manual.yaml @@ -61,6 +61,11 @@ jobs: - name: 4.构建jar包 run: | echo "===== 开始构建JAR包 =====" + # 新增:打印当前构建分支(两种方式双重确认) + echo "当前工作目录分支:$(git branch --show-current)" + echo "Gitea检出分支:${{ github.ref_name }}" + echo "预期构建分支:dev/3.1_release_merge" + echo "========================" mvn -B clean package -DskipTests --file pom.xml 2>&1 # 检查构建是否成功 if [ $? -ne 0 ]; then From aa2363b9a5657be1f4e72002e96cc0c62a42ad40 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 2 Dec 2025 12:11:04 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?elop=5Fbuild=5Fmanual.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/develop_build_manual.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/develop_build_manual.yaml b/.gitea/workflows/develop_build_manual.yaml index 1a755802..6d531d3b 100644 --- a/.gitea/workflows/develop_build_manual.yaml +++ b/.gitea/workflows/develop_build_manual.yaml @@ -66,7 +66,7 @@ jobs: echo "Gitea检出分支:${{ github.ref_name }}" echo "预期构建分支:dev/3.1_release_merge" echo "========================" - mvn -B clean package -DskipTests --file pom.xml 2>&1 + mvn -B clean install -DskipTests -Pdev 2>&1 # 检查构建是否成功 if [ $? -ne 0 ]; then echo "JAR包构建失败!" @@ -83,6 +83,7 @@ jobs: RUN echo 'Asia/Shanghai' > /etc/timezone ADD ./target/aida-0.0.1-SNAPSHOT.jar /app.jar ENTRYPOINT ["java","-jar","/app.jar"] + EOF echo "Dockerfile内容:" cat Dockerfile From b54eaea7e30b942cdbb87ef74cbe6d8d4e1d2a6c Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 2 Dec 2025 12:16:01 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?elop=5Fbuild=5Fmanual.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/develop_build_manual.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/develop_build_manual.yaml b/.gitea/workflows/develop_build_manual.yaml index 6d531d3b..fd4d3739 100644 --- a/.gitea/workflows/develop_build_manual.yaml +++ b/.gitea/workflows/develop_build_manual.yaml @@ -31,6 +31,7 @@ jobs: with: java-version: '21' distribution: 'temurin' + cache: 'maven' - name: 3.设置JAVA Maven 环境 run: | From ae1a2eff2a5996a073a30a39b76bf5bdd36ae358 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 2 Dec 2025 13:12:38 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?elop=5Fbuild=5Fmanual.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/develop_build_manual.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/develop_build_manual.yaml b/.gitea/workflows/develop_build_manual.yaml index fd4d3739..ce2c0338 100644 --- a/.gitea/workflows/develop_build_manual.yaml +++ b/.gitea/workflows/develop_build_manual.yaml @@ -78,7 +78,7 @@ jobs: run: | echo "===== 生成Dockerfile =====" cat > Dockerfile << 'EOF' - FROM openjdk:21 + FROM openjdk:21-ea-21-jdk-slim VOLUME /tmp RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone From 70d498b90ddf4644cc7691d9e2ce9acc20f329a1 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 2 Dec 2025 13:14:26 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/dev?= =?UTF-8?q?elop=5Fbuild=5Fmanual.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/develop_build_manual.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/develop_build_manual.yaml b/.gitea/workflows/develop_build_manual.yaml index ce2c0338..2121a10f 100644 --- a/.gitea/workflows/develop_build_manual.yaml +++ b/.gitea/workflows/develop_build_manual.yaml @@ -31,7 +31,6 @@ jobs: with: java-version: '21' distribution: 'temurin' - cache: 'maven' - name: 3.设置JAVA Maven 环境 run: | @@ -82,7 +81,7 @@ jobs: VOLUME /tmp RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' > /etc/timezone - ADD ./target/aida-0.0.1-SNAPSHOT.jar /app.jar + ADD ./aida-0.0.1-SNAPSHOT.jar /app.jar ENTRYPOINT ["java","-jar","/app.jar"] EOF echo "Dockerfile内容:" From ac98cd01dbb3f4a395df6a4b84caa47885c88e7c Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 2 Dec 2025 13:53:43 +0800 Subject: [PATCH 09/12] =?UTF-8?q?DEV=20JDK=E7=89=88=E6=9C=AC=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=EF=BC=8Credis=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.properties | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 74b511b6..37b6a737 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -71,15 +71,15 @@ spring.rabbitmq.username=rabbit spring.rabbitmq.password=123456 spring.rabbitmq.virtual-host=/ -spring.redis.host=172.31.11.32 -#spring.redis.host=18.167.251.121 -spring.redis.port=6379 -spring.redis.database=1 -spring.redis.password=Aidlab -spring.redis.lettuce.pool.max-active=8 -spring.redis.lettuce.pool.max-idle=8 -spring.redis.lettuce.pool.min-idle=0 -spring.redis.lettuce.pool.max-wait=5 +spring.data.redis.host=172.31.11.32 +#spring.data.redis.host=18.167.251.121 +spring.data.redis.port=6379 +spring.data.redis.database=1 +spring.data.redis.password=Aidlab +spring.data.redis.lettuce.pool.max-active=8 +spring.data.redis.lettuce.pool.max-idle=8 +spring.data.redis.lettuce.pool.min-idle=0 +spring.data.redis.lettuce.pool.max-wait=5 redis.key.orderForGenerate=OrderForGenerate redis.key.generateCancelSet=GenerateCancelSet From 964ee1c5cc6890ec66d1029effc66fb39d396739 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Tue, 2 Dec 2025 14:18:18 +0800 Subject: [PATCH 10/12] =?UTF-8?q?dev=E6=95=B0=E6=8D=AE=E5=BA=93=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 37b6a737..9e73b8bd 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,7 +1,7 @@ server.port=5567 spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida_back?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true #spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida_back?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true #spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/test_aida_3.1?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true spring.datasource.primary.username=aida_con From aa0a787e3fceb525c72dec0cd1496a67902ffaa2 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Tue, 2 Dec 2025 14:27:31 +0800 Subject: [PATCH 11/12] =?UTF-8?q?dev=E8=B7=A8=E5=9F=9F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=88=9D=E6=AD=A5=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/common/security/config/SecurityConfig.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/common/security/config/SecurityConfig.java b/src/main/java/com/ai/da/common/security/config/SecurityConfig.java index b5fce9f2..5473978e 100644 --- a/src/main/java/com/ai/da/common/security/config/SecurityConfig.java +++ b/src/main/java/com/ai/da/common/security/config/SecurityConfig.java @@ -7,6 +7,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -57,7 +58,7 @@ public class SecurityConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception { httpSecurity - .cors(AbstractHttpConfigurer::disable) + .cors(Customizer.withDefaults()) .authorizeHttpRequests(auth -> auth .requestMatchers(securityProperties.getIgnorePaths()).permitAll() .anyRequest().authenticated() @@ -75,7 +76,6 @@ public class SecurityConfig { .successHandler(userLoginSuccessHandler) .failureHandler(userLoginFailureHandler) ) - .cors(AbstractHttpConfigurer::disable) .csrf(AbstractHttpConfigurer::disable) .sessionManagement(session -> session .sessionCreationPolicy(SessionCreationPolicy.STATELESS) From c36ba6211a6aa1d2e66149cc533b9d3328d2ac54 Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 2 Dec 2025 14:34:12 +0800 Subject: [PATCH 12/12] =?UTF-8?q?DEV=20=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 9e73b8bd..37b6a737 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,7 +1,7 @@ server.port=5567 spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida_back?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true #spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida_back?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true #spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/test_aida_3.1?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true spring.datasource.primary.username=aida_con