备份:修复前完整项目快照 2026-04-19

This commit is contained in:
root
2026-04-19 19:15:01 +08:00
parent 5266d7732b
commit d00f41a120
449 changed files with 89577 additions and 23251 deletions
+22
View File
@@ -0,0 +1,22 @@
const fs = require('fs');
const content = fs.readFileSync('middleware/auth.js', 'utf8');
// 修复JWT_SECRET,使其与utils/auth.js中的一致
const fixedContent = content
.replace(
"const JWT_SECRET = process.env.JWT_SECRET || 'your-secret-key-change-in-production';",
"const JWT_SECRET = process.env.JWT_SECRET || 'your-jwt-secret-change-in-production';"
);
// 写入修复后的文件
fs.writeFileSync('middleware/auth.js', fixedContent);
console.log('✅ 已修复middleware/auth.js中的JWT_SECRET');
// 验证修复
const fixedFileContent = fs.readFileSync('middleware/auth.js', 'utf8');
if (fixedFileContent.includes("'your-jwt-secret-change-in-production'")) {
console.log('✅ JWT_SECRET修复验证成功');
} else {
console.log('❌ JWT_SECRET修复验证失败');
process.exit(1);
}