17 lines
613 B
JavaScript
17 lines
613 B
JavaScript
|
|
const fs = require('fs');
|
||
|
|
const path = require('path');
|
||
|
|
|
||
|
|
const filePath = path.join(__dirname, 'src/core/security/SecurityHardeningService.ts');
|
||
|
|
let content = fs.readFileSync(filePath, 'utf8');
|
||
|
|
|
||
|
|
// 替换所有 this.redisService. 为 RedisService.
|
||
|
|
content = content.replace(/this\.redisService\./g, 'RedisService.');
|
||
|
|
|
||
|
|
// 修复 RedisService.set 调用 - 移除 'EX' 参数
|
||
|
|
// 只替换 , 'EX', 数字 的模式
|
||
|
|
content = content.replace(/,\s*'EX',\s*(\d+)/g, ', $1');
|
||
|
|
|
||
|
|
fs.writeFileSync(filePath, content, 'utf8');
|
||
|
|
console.log('File updated successfully');
|
||
|
|
console.log('Total lines:', content.split('\n').length);
|