From 1924bc370fc0776359d6176d975421f73b00d46a Mon Sep 17 00:00:00 2001 From: smallfawn <101914820+smallfawn@users.noreply.github.com> Date: Sun, 31 Dec 2023 16:50:09 +0800 Subject: [PATCH] Update wx_lccd.js --- wx_lccd.js | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/wx_lccd.js b/wx_lccd.js index cba3a61..921680d 100644 --- a/wx_lccd.js +++ b/wx_lccd.js @@ -36,8 +36,9 @@ class UserInfo { } } async main() { - - await this.task_sign(); + await this.user_info() + if(this.ckStatus){ + await this.task_sign(); if (this.signStatus == 0) { await this.task_sign(); } else if (this.signStatus == 1) { @@ -47,6 +48,8 @@ class UserInfo { $.log(`完成充电和看视频任务`) await this.task_complete(3) await this.task_complete(4) + } + } async task_sign() { try { @@ -75,6 +78,28 @@ class UserInfo { console.log(e); } } + async user_info() { + try { + let options = { + fn: "信息", + method: "get", + url: `https://shop.laichon.com/api/v1/member/userinfo`, + headers: this.headers, + } + let { body: result } = await $.httpRequest(options); + //console.log(options); + //console.log(result); + if(result.code_key == "success"){ + this.ckStatus = true + $.log(`当前[${result.data.mobile} 积分[${result.data.point}]]`) + }else { + this.ckStatus = false + console.log(result); + } + } catch (e) { + console.log(e); + } + } async task_double() { try { let options = {