Files
ai-community/generate-encrypted.js
qiudl 9e4ed2622d feat: 添加项目区域 - Coolbuy PaaS 作为项目展示
- 新增"项目"标签页,使用紫色主题
- Coolbuy PaaS 包含4个模块:租户端、平台端、Auth API、Foundation API
- 支持模块状态检测和搜索过滤
- 统计信息包含项目模块数量
- 修复加密脚本正则匹配问题

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 20:38:54 +10:30

26 lines
818 B
JavaScript

const CryptoJS = require('crypto-js');
const fs = require('fs');
// 读取原始 HTML
const originalHtml = fs.readFileSync('nav-home.html', 'utf8');
// 使用密码加密
const password = 'joylodging';
const encrypted = CryptoJS.AES.encrypt(originalHtml, password).toString();
// 读取模板
let template = fs.readFileSync('nav-home-encrypted.html', 'utf8');
// 使用正则替换已有的加密内容(匹配 const ENCRYPTED_CONTENT = "..." 格式)
template = template.replace(
/const ENCRYPTED_CONTENT = "[^"]*";/,
`const ENCRYPTED_CONTENT = "${encrypted}";`
);
// 写入最终文件
fs.writeFileSync('nav-home-encrypted.html', template);
console.log('Encryption complete!');
console.log('Encrypted content length:', encrypted.length);
console.log('First 100 chars:', encrypted.substring(0, 100));