mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-26 17:55:58 +08:00
feat(projects): 新增静态路由
This commit is contained in:
@@ -5,7 +5,6 @@ const CryptoSecret = '__CryptoJS_Secret__';
|
||||
/**
|
||||
* 加密数据
|
||||
* @param data - 数据
|
||||
* @param secret - 密钥
|
||||
*/
|
||||
export function encrypto(data: any) {
|
||||
const newData = JSON.stringify(data);
|
||||
@@ -14,11 +13,10 @@ export function encrypto(data: any) {
|
||||
|
||||
/**
|
||||
* 解密数据
|
||||
* @param ciphertext - 密文
|
||||
* @param secret - 密钥
|
||||
* @param cipherText - 密文
|
||||
*/
|
||||
export function decrypto(ciphertext: string) {
|
||||
const bytes = CryptoJS.AES.decrypt(ciphertext, CryptoSecret);
|
||||
export function decrypto(cipherText: string) {
|
||||
const bytes = CryptoJS.AES.decrypt(cipherText, CryptoSecret);
|
||||
const originalText = bytes.toString(CryptoJS.enc.Utf8);
|
||||
if (originalText) {
|
||||
return JSON.parse(originalText);
|
||||
|
||||
Reference in New Issue
Block a user