From 04a2f592b46071cdcfe3c7cf0bb37e32dd60702a Mon Sep 17 00:00:00 2001 From: F1sh2712 <138188133+F1sh2712@users.noreply.github.com> Date: Sat, 9 May 2026 02:30:42 +1000 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=9C=A8=20README=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=90=8E=E7=AB=AF=E7=9A=84=E4=B8=A4=E7=A7=8D?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E5=8A=A0=E8=BD=BD=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2552aa..ed61b38 100644 --- a/README.md +++ b/README.md @@ -107,12 +107,21 @@ docker compose up -d postgres redis > 生产环境用另一个 OAuth App(仓库维护者持有,回调注册的是 `https://involutionhell.com/...`),跟本地这套互不干扰。本地 `.env` 只放你自己的 dev key。 ### 4. 启动后端服务 -在根目录下直接启动 JVM 模式: +按以下任一方式启动: + +**方式 1:命令行启动** ```bash +set -a && . ./.env && set +a ./mvnw spring-boot:run ``` +`set -a` 让后续读到的变量自动 export 为环境变量,`. ./.env` 加载文件,`set +a` 关闭自动 export。这样 `.env` 里的变量会被传递给后续启动的 Spring Boot 进程。 + +**方式 2:IntelliJ IDEA 启动** + +安装 [EnvFile](https://plugins.jetbrains.com/plugin/7861-envfile) 插件后,在 Run Configuration → EnvFile 标签页中启用并选择 `.env` 文件,点击 Run 即可启动。 + 默认接口入口:`http://127.0.0.1:8080` ### 5. 调用示例接口