ui库和web端产品库合并版本(还需修复细节)

This commit is contained in:
2022-11-29 18:27:14 +08:00
parent 5e4bd93238
commit 8bf6c57668
151 changed files with 28267 additions and 49 deletions

23
ui/meta/js/encryption.js Normal file
View File

@@ -0,0 +1,23 @@
import CryptoJs from "../cdn/crypto-js";
/**
* 密码加密工具
* @param params
* @param c 加载尝试计数器
* @returns {string}
*/
export const $encryption = (params, c = 0) => {
if (CryptoJs) {
const key = "thanks,villcloud"
let iv = CryptoJs.enc.Latin1.parse(key)
let encrypted = CryptoJs.AES.encrypt(params.password, iv, {
iv,
mode: CryptoJs.mode.CBC,
padding: CryptoJs.pad.ZeroPadding
})
return encrypted.toString()
} else if (c < 10) {
setTimeout(() => $encryption(params, ++c), 200)
} else console.error("无法加载CryptoJs")
}
export default $encryption