//执行一个创建点众链接任务 const axios = require('axios'); const helper = require('../src/helper'); const config = require('../etc/config.json') const HttpClient = require('../src/HttpClient') const CMD = {} CMD.runTask = async function(data,main_info,PlatformInfo,call_back){ let tg_link_config = JSON.parse(main_info.tg_link_config) let chongzhi_id = tg_link_config['chongzhi_id'] let chongzhi_list = JSON.parse(PlatformInfo.chongzhi) let chongzhi_name = null let recharge_template_id = "" for (let index = 0; index < chongzhi_list.length; index++) { const cz_obj = chongzhi_list[index]; if(cz_obj.id==chongzhi_id){ chongzhi_name = cz_obj.name recharge_template_id = cz_obj.value break } } try { let client = new HttpClient() let clientId= config.dianzhong_config.clientId; let timestamp = new Date().getTime(); let bookId = data.product_id; let chapterIdx = 1; let name = data.product_name; let mediaSource = "dy"; let channelId = main_info.channelId; let batchId = ""; let CallbackConfigId = ""; let fromDrId = "zywzfromDrId"; let chapterChargeStart = 1; let chapterKandian = 0; let response = await client.post(config.dianzhong_config.create_link_host,{ clientId:clientId, timestamp:timestamp, bookId:bookId, chapterIdx:chapterIdx, name:name, mediaSource:mediaSource, channelId:channelId, batchId:batchId, CallbackConfigId:CallbackConfigId, fromDrId:fromDrId, chapterChargeStart:chapterChargeStart, chapterKandian:chapterKandian }) } catch (error) { console.error('fq_create_link :Error:', error); // 处理错误 } } module.exports = CMD;