e491: function(t, e, n) {
"use strict";
var r = n("3452"), i = n("21f2"), o = n("79b9"), a = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlOJu6TyygqxfWT7eLtGDwajtN\nFOb9I5XRb6khyfD1Yt3YiCgQWMNW649887VGJiGr/L5i2osbl8C9+WJTeucF+S76\nxFxdU6jE0NQ+Z+zEdhUTooNRaY5nZiu5PgDB0ED/ZKBUSLKL7eibMxZtMlUDHjm4\ngwQco1KRMDSmXSMkDwIDAQAB\n-----END PUBLIC KEY-----";
function s(t, e) {
return Math.floor(Math.random() * (e - t) + t);
}
t.exports = {
getPublicKey: function() {
return a;
},
createSignStr: function() {
return "production" !== o.env ? o.signStr : "".concat(Date.now()).concat(s(100, 999));
},
createApiKey: function(t) {
var e = new i.JSEncrypt();
return e.setPublicKey(a), e.encrypt(t);
},
createPrivateKey: function(t) {
return r.enc.Utf8.parse(t);
},
decryptData: function(t, e) {
var n = r.AES.decrypt(e, this.createPrivateKey(t), {
mode: r.mode.ECB
}), i = r.enc.Utf8.stringify(n).toString();
if (!i || "string" !== typeof i) throw new Error("数据解密失败");
var o = {};
try {
o = JSON.parse(i);
} catch (a) {
console.log(a);
}
return o;
}
};
}
"use strict";
var r = n("3452"), i = n("21f2"), o = n("79b9"), a = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlOJu6TyygqxfWT7eLtGDwajtN\nFOb9I5XRb6khyfD1Yt3YiCgQWMNW649887VGJiGr/L5i2osbl8C9+WJTeucF+S76\nxFxdU6jE0NQ+Z+zEdhUTooNRaY5nZiu5PgDB0ED/ZKBUSLKL7eibMxZtMlUDHjm4\ngwQco1KRMDSmXSMkDwIDAQAB\n-----END PUBLIC KEY-----";
function s(t, e) {
return Math.floor(Math.random() * (e - t) + t);
}
t.exports = {
getPublicKey: function() {
return a;
},
createSignStr: function() {
return "production" !== o.env ? o.signStr : "".concat(Date.now()).concat(s(100, 999));
},
createApiKey: function(t) {
var e = new i.JSEncrypt();
return e.setPublicKey(a), e.encrypt(t);
},
createPrivateKey: function(t) {
return r.enc.Utf8.parse(t);
},
decryptData: function(t, e) {
var n = r.AES.decrypt(e, this.createPrivateKey(t), {
mode: r.mode.ECB
}), i = r.enc.Utf8.stringify(n).toString();
if (!i || "string" !== typeof i) throw new Error("数据解密失败");
var o = {};
try {
o = JSON.parse(i);
} catch (a) {
console.log(a);
}
return o;
}
};
}