1234567891011121314151617181920212223242526272829 |
- const { message: { checkSignature } } = require('../qcloud')
- async function get (ctx, next) {
- const { signature, timestamp, nonce, echostr } = ctx.query
- if (checkSignature(signature, timestamp, nonce)) ctx.body = echostr
- else ctx.body = 'ERR_WHEN_CHECK_SIGNATURE'
- }
- async function post (ctx, next) {
-
- const { signature, timestamp, nonce } = ctx.query
- if (!checkSignature(signature, timestamp, nonce)) ctx.body = 'ERR_WHEN_CHECK_SIGNATURE'
-
-
- ctx.body = 'success'
- }
- module.exports = {
- post,
- get
- }
|