@@ -85,16 +85,15 @@ async function doTask() {
8585 var detailBody = { "groupId" : item . matGrpId , "stageId" : stageId , "subTitleId" : item . subTitleId , "batchId" : item . batchId , "skuId" : "" , "taskId" : Number ( item . taskId ) }
8686 var goldCreatorDetail = await doGet ( "https://api.m.jd.com/client.action?functionId=goldCreatorDetail&body=" + encodeURIComponent ( JSON . stringify ( detailBody ) ) + "&appid=content_ecology&clientVersion=10.0.0&client=wh5" )
8787 if ( goldCreatorDetail . isSuccess == true ) {
88- console . log ( JSON . stringify ( goldCreatorDoTask . result ) ) ;
8988 //主题投票
9089 if ( goldCreatorDetail . result . skuList != undefined ) {
9190 var sku = goldCreatorDetail . result . skuList [ 0 ] ;
9291 var taskBody = { "stageId" : stageId , "subTitleId" : item . subTitleId , "skuId" : sku . skuId , "taskId" : Number ( item . taskId ) , "itemId" : "3" , "rankId" : sku . rankId , "type" : 1 , "batchId" : item . batchId }
9392 var goldCreatorDoTask = await doGet ( "https://api.m.jd.com/client.action?functionId=goldCreatorDoTask&body=" + encodeURIComponent ( JSON . stringify ( taskBody ) ) + "&appid=content_ecology&clientVersion=10.0.0&client=wh5" ) ;
9493 await $ . wait ( 700 ) ;
9594 if ( goldCreatorDoTask . isSuccess == true ) {
96- message += "主题: " + item . shortTitle + ",投票: " + sku . name + "\n" ;
97- message += "投票结果: " + JSON . stringify ( goldCreatorDoTask . result ) + "\n\n" ;
95+ message += "主题: " + item . shortTitle + "--投票给: " + sku . name + "\n" ;
96+ message += "投票结果: " + JSON . stringify ( goldCreatorDoTask . result ) + "\n\n" ;
9897 }
9998 else {
10099 console . log ( '执行投票任务失败' ) ;
@@ -103,13 +102,14 @@ async function doTask() {
103102 //额外任务
104103 if ( goldCreatorDetail . result . taskList != undefined ) {
105104 for ( let task of goldCreatorDetail . result . taskList ) {
105+ task = task [ 0 ] ;
106106 if ( task . taskStatus == 1 ) {
107107 var taskBody = { "taskId" : Number ( task . taskId ) , "itemId" : task . taskItemInfo . itemId , "taskType" : task . taskType , "batchId" : "1" }
108108 var goldCreatorDoTask = await doGet ( "https://api.m.jd.com/client.action?functionId=goldCreatorDoTask&body=" + encodeURIComponent ( JSON . stringify ( taskBody ) ) + "&appid=content_ecology&clientVersion=10.0.0&client=wh5" ) ;
109109 await $ . wait ( 700 ) ;
110110 if ( goldCreatorDoTask . isSuccess == true ) {
111- message += "执行任务: " + task . taskName + "--" + task . taskItemInfo . title + "\n" ;
112- message += "执行结果: " + JSON . stringify ( goldCreatorDoTask . result ) + "\n\n" ;
111+ message += "执行任务: " + task . taskName + "--" + task . taskItemInfo . title + "\n" ;
112+ message += "执行结果: " + JSON . stringify ( goldCreatorDoTask . result ) + "\n\n" ;
113113 }
114114 else {
115115 console . log ( '执行额外任务失败' ) ;
0 commit comments