qm_create_link.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //执行一个创建七猫链接任务
  2. const axios = require('axios');
  3. const helper = require('../src/helper');
  4. const config = require('../etc/config.json')
  5. const HttpClient = require('../src/HttpClient')
  6. const CMD = {}
  7. CMD.runTask = async function(data,main_info,PlatformInfo,call_back){
  8. let tg_link_config = JSON.parse(main_info.tg_link_config)
  9. let chongzhi_id = tg_link_config['chongzhi_id']
  10. let chongzhi_list = JSON.parse(PlatformInfo.chongzhi)
  11. let chongzhi_name = null
  12. let recharge_template_id = ""
  13. let appid = main_info.app_id
  14. for (let index = 0; index < chongzhi_list.length; index++) {
  15. const cz_obj = chongzhi_list[index];
  16. if(cz_obj.id==chongzhi_id){
  17. chongzhi_name = cz_obj.name
  18. recharge_template_id = cz_obj.value
  19. break
  20. }
  21. }
  22. try {
  23. let client = new HttpClient()
  24. let response = await client.request(config.qimao_config.create_link_host,{
  25. admin_account_name:config.qimao_config.admin_account_name,
  26. project:6, //6 - 抖音小程序 8 - 微信小程序
  27. appid:appid,
  28. // create_time_start:0,
  29. // create_time_end:0,
  30. // last_modify_time_start:0,
  31. // last_modify_time_end:0,
  32. // page:0,
  33. // page_size:0
  34. })
  35. return response
  36. } catch (error) {
  37. console.error('fq_create_link :Error:', error);
  38. // 处理错误
  39. }
  40. }
  41. module.exports = CMD;