Commit 261735da by 宋毅

tj

parent 28f2f6f2
......@@ -96,6 +96,9 @@ class ToolService {
};
//加密信息
async encryptStr(app, opStr) {
if (!opStr) {
return system.getResult(null, "opStr is not empty");
}
let keyHex = cryptoJS.enc.Utf8.parse(app.uappKey);
let ivHex = cryptoJS.enc.Utf8.parse(app.appSecret.substring(0, 8));
var cipherStr = cryptoJS.TripleDES.encrypt(opStr, keyHex, { iv: ivHex }).toString();
......@@ -103,6 +106,9 @@ class ToolService {
}
//解密信息
async decryptStr(app, opStr) {
if (!opStr) {
return system.getResult(null, "opStr is not empty");
}
let keyHex = cryptoJS.enc.Utf8.parse(app.uappKey);
let ivHex = cryptoJS.enc.Utf8.parse(app.appSecret.substring(0, 8));
var bytes = cryptoJS.TripleDES.decrypt(opStr, keyHex, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment