get_dz_call_back_template.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. const CMD = {}
  2. const HttpClient = require('../../../src/HttpClient')
  3. const config = require('../../../etc/config.json')
  4. const helper = require('../../helper')
  5. // 获取点众回传模板
  6. CMD.get_callback_template = async function(channelId,call_back){
  7. let clinet = new HttpClient()
  8. let timestamp = helper.getCurrentUnixTimestamp()
  9. let signKey = helper.md5(config.dianzhong_config.clientId+config.dianzhong_config.token+timestamp)
  10. let response = await clinet.post(config.dianzhong_config.callbacklist_hots,{
  11. channelId:channelId,
  12. clientId:config.dianzhong_config.clientId,
  13. timestamp:timestamp,
  14. type:config.dianzhong_config.type,
  15. signKey:signKey
  16. })
  17. call_back(response)
  18. }
  19. // 获取点众免费回传模板
  20. CMD.get_mf_callback_template = async function(channelId,call_back){
  21. let clinet = new HttpClient()
  22. let timestamp = helper.getCurrentUnixTimestamp()
  23. let signKey = helper.md5(config.dianzhong_mf_channel_config.clientId+config.dianzhong_mf_channel_config.token+timestamp)
  24. let response = await clinet.post(config.dianzhong_config.callbacklist_hots,{
  25. channelId:channelId,
  26. clientId:config.dianzhong_mf_channel_config.clientId,
  27. timestamp:timestamp,
  28. type:config.dianzhong_config.type,
  29. signKey:signKey
  30. })
  31. call_back(response)
  32. }
  33. module.exports = CMD;