提交
This commit is contained in:
17
packageRc/components/verifition/utils/ase.js
Normal file
17
packageRc/components/verifition/utils/ase.js
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user