From 8ec081be590fd9c71a1823d58e6891d1861a7554 Mon Sep 17 00:00:00 2001 From: zjk2017 <2548836866@qq.com> Date: Thu, 26 Dec 2024 22:57:21 +0800 Subject: [PATCH] Update qtx.js --- qtx.js | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/qtx.js b/qtx.js index 30e9543..2041abb 100644 --- a/qtx.js +++ b/qtx.js @@ -1,8 +1,10 @@ /** * 青碳行 * cron: 9 5 * * * - * fix 20240623 原作者smallfawn 增加分享功能 实物可以搞 - * ========= 青龙--配置文件 =========== + * fix 20240623 原作者smallfawn 增加分享功能 + *20241226 修复bug + 可以换实物可以做地铁有优惠 + ========= 青龙--配置文件 =========== * # 项目名称 * export qtxtk='token&deviceCoding' * @@ -25,6 +27,9 @@ let userCookie = ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || ''; let userList = []; let userIdx = 0; let userCount = 0; + +//let date = new Date(); + //---------------------- 自定义变量区域 ----------------------------------- //--------------------------------------------------------- @@ -97,7 +102,17 @@ class UserInfo { } +this.headersv2 = { + 'Content-Type': 'application/json; charset=utf-8', + 'Host': 'carbon.lcago.cn', + 'channel': 'qtx', + 'Connection': 'Keep-Alive', + 'token':this.ck, + + //'Accept-Encoding': 'gzip', + 'User-Agent': 'okhttp/3.12.' + } } getRandomTime() { @@ -158,13 +173,22 @@ async walk() { } - async task_signIn() {//userinfo - try { - let options = { - url: `https://carbon.lcago.cn/signIn/sign`, - headers: this.headers, - body: `{"token":"${this.ck}","platform":"android","model":"MI8","appChannel":"qtx","version":"1.3.3_VersionCode_111","deviceCoding":"${this.deviceCoding}","language":"ZH","systemversion":"10"}` + getFormattedDate() { + const sillyDatetime = require('silly-datetime'); + const date = sillyDatetime.format(new Date(), 'YYYY-MM-DD'); + return date; +} +// 调用函数获取日期并输出 + +//#console.log(today); + async task_signIn() { + try { + const today = this.getFormattedDate(); + let options = { + url: `https://carbon.lcago.cn/signIn/v2/sign`, + headers: this.headersv2, + body: `{"signType":0,"signDate":"${today}"}` } //console.log(options); let result = await httpRequest(options);