From ff5283a66fe406a8eedc94ff2950547897fa4838 Mon Sep 17 00:00:00 2001 From: Aritro37 <85866469+Aritro37@users.noreply.github.com> Date: Wed, 19 Mar 2025 15:07:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8=20.?= =?UTF-8?q?env=20=E6=97=B6=20/api/utils/env=20=E6=8E=A5=E5=8F=A3=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=20env=20=E5=AD=97=E6=AE=B5=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main.js | 4 ---- backend/src/vendor/open-api.js | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main.js b/backend/src/main.js index 3ba7bf1..594f6ec 100644 --- a/backend/src/main.js +++ b/backend/src/main.js @@ -19,10 +19,6 @@ console.log( ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ `, ); -if ($.env.isNode) { - const dotenv = eval(`require("dotenv")`); - dotenv.config(); -} import migrate from '@/utils/migration'; import serve from '@/restful'; diff --git a/backend/src/vendor/open-api.js b/backend/src/vendor/open-api.js index 3c32b81..d73a0c7 100644 --- a/backend/src/vendor/open-api.js +++ b/backend/src/vendor/open-api.js @@ -18,6 +18,10 @@ export class OpenAPI { this.http = HTTP(); this.env = ENV(); + if (isNode) { + const dotenv = eval(`require("dotenv")`); + dotenv.config(); + } this.node = (() => { if (isNode) { const fs = eval("require('fs')");