fix: 调试配置和环境变量路径调整,确保读取 backend 目录下的 .env 文件

This commit is contained in:
mazxd
2025-05-11 11:15:22 +08:00
parent 9b2584d32c
commit b1d91bef88
10 changed files with 8265 additions and 5815 deletions
+3 -1
View File
@@ -7,4 +7,6 @@ MYSQL_HOST=192.168.1.126
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=rootroot
MYSQL_DATABASE=bps
MYSQL_DATABASE=bps
SEARCH_SERVICE_USERNAME=mzaxd
SEARCH_SERVICE_PASSWORD=200712
+17
View File
@@ -20,6 +20,7 @@
"express-rate-limit": "^7.1.0",
"ioredis": "^5.3.0",
"node-cron": "^3.0.0",
"pnpm": "^10.10.0",
"redis": "^5.0.1",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
@@ -4504,6 +4505,22 @@
"node": ">=8"
}
},
"node_modules/pnpm": {
"version": "10.10.0",
"resolved": "https://registry.npmjs.org/pnpm/-/pnpm-10.10.0.tgz",
"integrity": "sha512-1hXbJG/nDyXc/qbY1z3ueCziPiJF48T2+Igkn7VoFJMYY33Kc8LFyO8qTKDVZX+5VnGIv6tH9WbR7mzph4FcOQ==",
"license": "MIT",
"bin": {
"pnpm": "bin/pnpm.cjs",
"pnpx": "bin/pnpx.cjs"
},
"engines": {
"node": ">=18.12"
},
"funding": {
"url": "https://opencollective.com/pnpm"
}
},
"node_modules/pretty-format": {
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz",
+1
View File
@@ -24,6 +24,7 @@
"express-rate-limit": "^7.1.0",
"ioredis": "^5.3.0",
"node-cron": "^3.0.0",
"pnpm": "^10.10.0",
"redis": "^5.0.1",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
+2589 -1906
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -1,6 +1,8 @@
import dotenv from 'dotenv';
import path from 'path';
dotenv.config();
// 加载 backend 目录的 .env 文件
dotenv.config({ path: path.resolve(__dirname, '../../.env') });
// Add debug logging
console.log('Environment variables loaded:', {