Skip to content

Commit

Permalink
fix: server酱api更新 (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: meooxx <[email protected]>
  • Loading branch information
xxxXXX95 and meooxx authored Mar 23, 2022
1 parent 288501e commit 29282cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function submitOrderFromItemDetailPage(
await helper.submitOrder(skuId).then(async r => {
console.log(r);
if (r.success) {
await helper.sendToWechat(r);
await helper.sendToWechat(r, true);
process.exit();
}
if (i === concurrency) {
Expand Down Expand Up @@ -373,7 +373,7 @@ async function submitOrderFromShoppingCart(
now
).format('YYYY-MM-DD HH:mm:ss.SSS')}`;
console.log(text);
await helper.sendToWechat(text);
await helper.sendToWechat(text, true);
return true;
} else {
if (res.noStockSkuIds) {
Expand Down
6 changes: 3 additions & 3 deletions tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,12 +583,12 @@ class Tools {
return {};
}
};
sendToWechat = message => {
sendToWechat = async (message, success) => {
if (!message) return;
if (!config.messenger) return;
const url = `http://sc.ftqq.com/${this.config.sckey}.send`;
const url = `https://sctapi.ftqq.com/${this.config.sckey}.send`;
const payload = {
text: '抢购结果',
title: success ? '抢购成功✅' : '抢购失败❌',
desp: message
};
return this.request(url + `?${qs.stringify(payload)}`);
Expand Down

0 comments on commit 29282cf

Please sign in to comment.