From 075165f89d30e02542d8de3715f88b4092957bcf Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 18 Jul 2022 16:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dql=5Fdir=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/config/index.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/back/config/index.ts b/back/config/index.ts index b8e2ece1..2aa8a8a4 100644 --- a/back/config/index.ts +++ b/back/config/index.ts @@ -3,13 +3,16 @@ import path from 'path'; import { createRandomString } from './util'; process.env.NODE_ENV = process.env.NODE_ENV || 'development'; -// 声明QL_DIR环境变量 -let qlHomePath = path.join(__dirname, '../../'); -// 生产环境 -if (qlHomePath.endsWith('/static/')) { - qlHomePath = path.join(qlHomePath, '../'); + +if (!process.env.QL_DIR) { + // 声明QL_DIR环境变量 + let qlHomePath = path.join(__dirname, '../../'); + // 生产环境 + if (qlHomePath.endsWith('/static/')) { + qlHomePath = path.join(qlHomePath, '../'); + } + process.env.QL_DIR = qlHomePath; } -process.env.QL_DIR = qlHomePath; const lastVersionFile = `http://qn.whyour.cn/version.ts?v=${Date.now()}`;