From 728d84cb155fdbf9786953c286d35c94837af109 Mon Sep 17 00:00:00 2001 From: whyour Date: Thu, 9 Jun 2022 16:44:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=B9=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/loaders/initFile.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/back/loaders/initFile.ts b/back/loaders/initFile.ts index 9e9c3b92..90899fd9 100644 --- a/back/loaders/initFile.ts +++ b/back/loaders/initFile.ts @@ -65,7 +65,11 @@ export default async () => { dotenv.config({ path: confFile }); // 声明QL_DIR环境变量 - const qlHomePath = path.join(__dirname, '../../'); + let qlHomePath = path.join(__dirname, '../../'); + // 生产环境 + if (qlHomePath.endsWith('/static/')) { + qlHomePath = path.join(qlHomePath, '../'); + } process.env.QL_DIR = qlHomePath; Logger.info('✌️ Init file down');