ui库合并版本完成

This commit is contained in:
aixianling
2022-12-01 09:13:53 +08:00
parent fe3e06e654
commit 02a4b50fc0
39 changed files with 47 additions and 5989 deletions

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

@@ -0,0 +1,23 @@
import CryptoJs from "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