Skip to content

Commit 98da36f

Browse files
Update kfx.js
1 parent c85a3ee commit 98da36f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

kfx.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const token = $.isNode() ? process.env.kfxtoken : ""
55
const tokenList = token.split("&")
66
const logDebug = 0
77

8+
let cardsMsg = []
9+
810
function sign (token) {
911
return new Promise(async (resolve, reject) => {
1012
let url = `https://fscrm.kraftheinz.net.cn/crm/public/index.php/api/v1/dailySign`
@@ -48,12 +50,15 @@ function getScoreOrder(token,body){
4850
await httpRequest('post', urlObject)
4951
let result = httpResult;
5052
// console.log(result ? result.data : "")
51-
let respData = result.data.data;
53+
let respData = result?.data.data;
5254
let cards = []
53-
for(let i = 0; i < respData.length; i++){
54-
cards.push(respData[i].awardResult)
55+
for(let i = 0; i < respData?.length; i++){
56+
let temObj = JSON.parse(respData[i].awardResult)
57+
cards.push(temObj.cards.card)
58+
5559
}
56-
await notify.sendNotify(`卡数据`, `${cards}`)
60+
cardsMsg.push(cards)
61+
5762
resolve(true)
5863
})
5964
}
@@ -141,6 +146,9 @@ async function main () {
141146
}
142147

143148
}
149+
console.log(cardsMsg)
150+
151+
await notify.sendNotify(`卡数据`, `${JSON.stringify(cardsMsg)}`)
144152

145153
}
146154

0 commit comments

Comments
 (0)