Compare commits

..

No commits in common. "c42b125ac80c1bf7419a2e0f0ed4ed90ca296fce" and "f0e941237f0ee2403019f3feb0ee747eeb3d316e" have entirely different histories.

8 changed files with 168 additions and 186 deletions

View File

@ -172,7 +172,7 @@ class Task extends Public {
async function getNotice() { async function getNotice() {
let options = { let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, url: `https://gitee.com/smallfawn/Note/raw/main/Notice.json`,
headers: { headers: {
"User-Agent": defaultUserAgent, "User-Agent": defaultUserAgent,
} }

View File

@ -5,8 +5,8 @@
@Description: 测试 @Description: 测试
------------------------------------------ ------------------------------------------
#Notice: 只适用于购买了luflytoken的 购买联系QQ860562056 #Notice: 只适用于购买了luflytoken的 购买联系QQ860562056
变量wxid_bnmd 填写wxid_bnmd 多账号&分割或者换行 变量luflytoken 填写luflytoken
wxcenter 填写wxcenter 变量wxbnmdwxid 填写wxbnmdwxid 多账号&分割或者换行
免责声明 免责声明
------------------------------------------ ------------------------------------------
1此脚本仅用于学习研究不保证其合法性准确性有效性请根据情况自行判断本人对此不承担任何保证责任 1此脚本仅用于学习研究不保证其合法性准确性有效性请根据情况自行判断本人对此不承担任何保证责任
@ -19,7 +19,7 @@ wxcenter 填写wxcenter
*/ */
const $ = new Env("巴奴毛肚小程序"); const $ = new Env("巴奴毛肚小程序");
let ckName = `wxid_bnmd`; let ckName = `wxbnmdwxid`;
const strSplitor = "#"; const strSplitor = "#";
const envSplitor = ["&", "\n"]; const envSplitor = ["&", "\n"];
const crypto = require("crypto-js"); const crypto = require("crypto-js");
@ -27,7 +27,8 @@ const notify = $.isNode() ? require("../sendNotify") : "";
const axios = require("axios"); const axios = require("axios");
const defaultUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001e31) NetType/WIFI Language/zh_CN miniProgram" const defaultUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001e31) NetType/WIFI Language/zh_CN miniProgram"
const key = "bfc5e947cd84c7ced1ee48d28fb3e90f"; const key = "bfc5e947cd84c7ced1ee48d28fb3e90f";
let wxcenter = process.env.wxcenter || "" let luflytoken = process.env.luflytoken || ""
let wxcenter = 'http://w.smallfawn.top:5789'
let appid = 'wx71373698c47f9a9f' let appid = 'wx71373698c47f9a9f'
class Public { class Public {
async request(options) { async request(options) {
@ -119,22 +120,17 @@ class Task extends Public {
}))); })));
} }
async getcode() { async getcode() {
let options = { let options = {
url: `${wxcenter}/api/Wxapp/JSLogin`, url: `${wxcenter}/api/getcode`,
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
method: 'POST', method: 'POST',
data: { "Wxid": "" + this.wxid, "Appid": "" + appid } data: { "luflyKey": "" + luflytoken, "wxid": "" + this.wxid, "appid": "" + appid }
} }
let { data: result } = await this.request(options); let { data: result } = await this.request(options);
if (result.status) {
let code = result.data
if (result.Success) {
let code = result.Data.code
$.log(`账号[${this.wxid}] 获取code成功[${code}]`); $.log(`账号[${this.wxid}] 获取code成功[${code}]`);
let { member_id: memberId, openid: authorization } = await this.login(code) let { member_id: memberId, openid: authorization } = await this.login(code)
const headerObj = {}; const headerObj = {};
@ -163,19 +159,15 @@ class Task extends Public {
headers: this.getHeaders(headerObj, false, authorization) headers: this.getHeaders(headerObj, false, authorization)
}); });
const result = "\nMember_id:" + memberId + "\n用户名:" + info.data.data.name + "\n总积分:" + info.data.data.points; const result = "\nMember_id:" + memberId + "\n用户名:" + info.data.data.name + "\n总积分:" + info.data.data.points;
$.log(result);
} catch (err) { } catch (err) {
$.log("签到失败:" + err + " | 签到时间:" + Date.now()); console.log("签到失败:" + err + " | 签到时间:" + Date.now());
} }
} else { } else {
console.log(result); console.log(result);
} }
} }
async login(code) { async login(code) {
let url = 'https://cloud.banu.cn/api/wx/weapp/auth'; let url = 'https://cloud.banu.cn/api/wx/weapp/auth';
@ -196,7 +188,6 @@ class Task extends Public {
return res.data; return res.data;
} }
async run() { async run() {
if (!wxcenter) return $.log(`请填写wxcenter`)
await this.getcode() await this.getcode()
@ -224,7 +215,7 @@ class Task extends Public {
async function getNotice() { async function getNotice() {
let options = { let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, url: `https://gitee.com/smallfawn/Note/raw/main/Notice.json`,
headers: { headers: {
"User-Agent": defaultUserAgent, "User-Agent": defaultUserAgent,
} }

View File

@ -156,7 +156,7 @@ class Task extends Public {
async function getNotice() { async function getNotice() {
let options = { let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, url: `https://gitee.com/smallfawn/Note/raw/main/Notice.json`,
headers: { headers: {
"User-Agent": defaultUserAgent, "User-Agent": defaultUserAgent,
} }

View File

@ -131,7 +131,7 @@ class Task extends Public {
async function getNotice() { async function getNotice() {
let options = { let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, url: `https://gitee.com/smallfawn/Note/raw/main/Notice.json`,
headers: { headers: {
"User-Agent": defaultUserAgent, "User-Agent": defaultUserAgent,
} }

View File

@ -1,8 +1,8 @@
/** /**
* cron 25 10 * * * wx_ZIWI+.js * cron 25 10 * * * wx_ZIWI+.js
* 积分换 猫粮狗粮 * 积分换 猫粮狗粮
* 变量名wxid_ziwi 值为lufly登录授权的微信id 用于获取微信CODE 来刷新CK * 变量名wxziwiwxid 值为lufly登录授权的微信id 用于获取微信CODE 来刷新CK
* 变量名wxcenter 谨慎使用加密本 防止偷取TOKEN * 变量名luflytoken 谨慎使用加密本 防止偷取TOKEN
* *
* *
* *
@ -12,13 +12,13 @@
const $ = new Env("微信小程序ZIWI+"); const $ = new Env("微信小程序ZIWI+");
const notify = $.isNode() ? require('../sendNotify') : ''; const notify = $.isNode() ? require('../sendNotify') : '';
let ckName = "wxid_ziwi"; let ckName = "wxziwiwxid";
let envSplitor = ["&", "\n"]; //多账号分隔符 let envSplitor = ["&", "\n"]; //多账号分隔符
let strSplitor = "#"; //多变量分隔符 let strSplitor = "#"; //多变量分隔符
let userIdx = 0; let userIdx = 0;
let userList = []; let userList = [];
let appid = 'wxb26a710e583b05dc' let appid = 'wxb26a710e583b05dc'
let wxcenter = process.env['wxcenter'] || '' let wxcenter = 'http://w.smallfawn.top:5789'
class Task { class Task {
constructor(str) { constructor(str) {
this.index = ++userIdx; this.index = ++userIdx;
@ -29,34 +29,25 @@ class Task {
this.ck = '' this.ck = ''
} }
async main() { async main() {
if (!wxcenter) return $.log(`请填写wxcenter`)
await this.getCode() await this.getCode()
} }
async getCode() { async getCode() {
let options = { let { body: result } = await $.httpRequest({
url: `${wxcenter}/api/Wxapp/JSLogin`, method: 'post', headers: {
headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, }, url: wxcenter + '/api/getcode', body: JSON.stringify({ "luflyKey": process.env['luflytoken'], "wxid": "" + this.wxid, "appid": appid })
method: 'POST', })
body: JSON.stringify({ "Wxid": "" + this.wxid, "Appid": "" + appid }) if (result) {
} console.log(result)
let { body: result } = await $.httpRequest(options); if (result.status) {
let code = result.data
if (result.Success) {
let code = result.Data.code
await this.getJwtByCode(code) await this.getJwtByCode(code)
}
} else {
$.log(`账号[${this.index}]【${this.name}】 获取code失败`);
} }
} }
async getJwtByCode(code) { async getJwtByCode(code) {

View File

@ -134,7 +134,7 @@ class Task extends Public {
async function getNotice() { async function getNotice() {
let options = { let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, url: `https://gitee.com/smallfawn/Note/raw/main/Notice.json`,
headers: { headers: {
"User-Agent": defaultUserAgent, "User-Agent": defaultUserAgent,
} }

View File

@ -162,7 +162,7 @@ class Task extends Public {
async function getNotice() { async function getNotice() {
let options = { let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, url: `https://gitee.com/smallfawn/Note/raw/main/Notice.json`,
headers: { headers: {
"User-Agent": defaultUserAgent, "User-Agent": defaultUserAgent,
} }

View File

@ -69,7 +69,7 @@ class Task extends Public {
async function getNotice() { async function getNotice() {
let options = { let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, url: `https://gitee.com/smallfawn/Note/raw/main/Notice.json`,
headers: { headers: {
"User-Agent": defaultUserAgent, "User-Agent": defaultUserAgent,
} }