mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-06-01 15:49:16 +08:00
修改rsa加密方式
This commit is contained in:
parent
6291db9dea
commit
f3780f8ccf
@ -15,6 +15,8 @@ export default [
|
||||
msg: "success",
|
||||
data: {
|
||||
mockServer: true,
|
||||
publicKey:
|
||||
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBT2vr+dhZElF73FJ6xiP181txKWUSNLPQQlid6DUJhGAOZblluafIdLmnUyKE8mMHhT3R+Ib3ssZcJku6Hn72yHYj/qPkCGFv0eFo7G+GJfDIUeDyalBN0QsuiE/XzPHJBuJDfRArOiWvH0BXOv5kpeXSXM8yTt5Na1jAYSiQ/wIDAQAB",
|
||||
},
|
||||
};
|
||||
},
|
||||
|
@ -13,14 +13,13 @@ const privateKey =
|
||||
export async function encryptedData(data) {
|
||||
let publicKey = "";
|
||||
const res = await getPublicKey();
|
||||
publicKey = res.data;
|
||||
if (publicKey.mockServer) {
|
||||
publicKey = res.data.publicKey;
|
||||
if (res.data.mockServer) {
|
||||
publicKey = "";
|
||||
}
|
||||
if (publicKey == "") {
|
||||
return data;
|
||||
}
|
||||
|
||||
const encrypt = new JSEncrypt();
|
||||
encrypt.setPublicKey(
|
||||
`-----BEGIN PUBLIC KEY-----${publicKey}-----END PUBLIC KEY-----`
|
||||
|
Loading…
x
Reference in New Issue
Block a user