add post of workflow notify

This commit is contained in:
zhl 2023-04-05 17:42:53 +08:00
parent f494a89f5c
commit 6948958cf3

View File

@ -24,4 +24,18 @@ class WorkFlowController extends BaseController {
const { message, id } = decrypt(AES_KEY, echostr)
res.send(message)
}
@role('anon')
@router('post /workflow/notify')
async flowNotify(req, res) {
let { msg_signature, timestamp, nonce, echostr } = req.params
const signature = getSignature(TOKEN, timestamp, nonce, echostr)
if (msg_signature !== signature) {
throw new ZError(10, 'params mismatch')
}
const { message, id } = decrypt(AES_KEY, echostr)
console.log(id)
console.log(message)
res.send('success')
}
}