feat: add verification comp【31315a7f】

This commit is contained in:
YunaiV
2025-03-24 20:13:42 +08:00
parent 1112409a3b
commit eeb19808c9
12 changed files with 1298 additions and 16 deletions

View File

@@ -0,0 +1,15 @@
import CryptoJS from 'crypto-js';
/**
* @word 要加密的内容
* @keyWord String 服务器随机返回的关键字
*/
export function aesEncrypt(word: string, keyWord = 'XwKsGlMcdPMEhR1B') {
const key = CryptoJS.enc.Utf8.parse(keyWord);
const src = CryptoJS.enc.Utf8.parse(word);
const encrypted = CryptoJS.AES.encrypt(src, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7,
});
return encrypted.toString();
}