Files
dvcp-node-service/src/rest/addressBook/actionGet.js

16 lines
551 B
JavaScript

const {getSignature, decrypt} = require("@wecom/crypto");
const token = "OTUlglGGoGm7EKKpKeg6tc"
const encodingAESKey = "LHLwd2nhbia4iCEfyDJkUPBb9TT7G8GMlWpgqzNHODi"
module.exports = {
action: "/wxwork/addressBook/action",
method: "get",
execute: (request, response) => {
const {msg_signature, timestamp, nonce, Encrypt} = request.query
const signature = getSignature(token, timestamp, nonce, Encrypt);
if (msg_signature == signature) {
const context = decrypt(encodingAESKey, Encrypt)
response.send(context)
}
}
}