mirror of
https://github.com/dataease/dataease.git
synced 2026-05-20 19:48:18 +08:00
feat: 登录时,对用户名密码加密
This commit is contained in:
@@ -16,6 +16,7 @@ const privateKey = 'MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdb
|
||||
|
||||
// 加密
|
||||
export function encrypt(txt) {
|
||||
let publicKey = localStorage.getItem("publicKey");
|
||||
const encryptor = new JSEncrypt()
|
||||
encryptor.setPublicKey(publicKey) // 设置公钥
|
||||
return encryptor.encrypt(txt) // 对需要加密的数据进行加密
|
||||
@@ -28,3 +29,4 @@ export function decrypt(txt) {
|
||||
return encryptor.decrypt(txt)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user