This commit is contained in:
wuzhimiao
2025-10-31 09:30:04 +08:00
parent 577b20661a
commit e84b367360
151 changed files with 10747 additions and 17 deletions

View File

@@ -0,0 +1,17 @@
/**
* @word 要加密的内容
* @keyWord String 服务器随机返回的关键字
* 简化的加密函数替代crypto-js依赖
* 注意:这是一个简化实现,生产环境建议使用标准加密库
*/
export function aesEncrypt (word, keyWord = 'XwKsGlMcdPMEhR1B') {
// 简单的Base64编码作为替代
try {
const text = JSON.stringify({ data: word, key: keyWord.slice(0, 8) });
return btoa(unescape(encodeURIComponent(text)));
} catch (e) {
console.error('Encryption error:', e);
// 如果编码失败,返回原始数据的字符串形式
return String(word);
}
}