fix some bug

This commit is contained in:
smallfawn 2026-04-12 13:12:04 +08:00
parent 18eccc4f36
commit 585efa7a3e
7 changed files with 192 additions and 157 deletions

View File

@ -1,152 +0,0 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description: 测试
cron 8 10 * * *
------------------------------------------
#Notice:
变量名kekoukeleba 抓小程序可口可乐吧 member-api.icoke.cn/api Headers中 authorization 去掉Bearer 多账号&连接
免责声明
------------------------------------------
1此脚本仅用于学习研究不保证其合法性准确性有效性请根据情况自行判断本人对此不承担任何保证责任
2由于此脚本仅用于学习研究您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除若违反规定引起任何事件本人对此均不负责
3请勿将此脚本用于任何商业或非法目的若违反规定请自行对此负责
4此脚本涉及应用与本人无关本人对因此引起的任何隐私泄漏或其他后果不承担任何责任
5本人对任何脚本引发的问题概不负责包括但不限于由脚本错误引起的任何损失和损害
6如果任何单位或个人认为此脚本可能涉嫌侵犯其权利应及时通知并提供身份证明所有权证明我们将在收到认证文件确认后删除此脚本
7所有直接或间接使用查看此脚本的人均应该仔细阅读此声明本人保留随时更改或补充此声明的权利一旦您使用或复制了此脚本即视为您已接受此免责声明
*/
const { Env } = require('../tools/env');
const $ = new Env("可口可乐吧");
let ckName = `kekoukeleba`;
const strSplitor = "#";
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"
class Public {
request(options) {
return axios.request(options);
}
}
class Task extends Public {
constructor(env) {
super();
this.index = $.userIdx++
let user = env.split(strSplitor);
this.token = user[0];
this.isSign = false;
}
async addSign() {
let options = {
method: "GET",
url: "https://member-api.icoke.cn/api/icoke-sign/icoke/mini/sign/main/sign",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "" + this.token,
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"xweb_xhr": "1",
"Referer": "https://servicewechat.com/wxa5811e0426a94686/421/page-frame.html",
"Referrer-Policy": "unsafe-url"
},
}
try {
let { data: res } = await this.request(options);
if (res.success == true) {
$.log(`签到成功 获得【${res.point}】快乐瓶`)
} else {
$.log(`签到失败`)
console.log(res);
}
} catch (e) {
console.log(e);
}
}
async userInfo() {
let options = {
method: "GET",
url: "https://member-api.icoke.cn/api/icoke-customer/icoke/mini/customer/main/points",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "" + this.token,
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"xweb_xhr": "1",
"Referer": "https://servicewechat.com/wxa5811e0426a94686/421/page-frame.html",
"Referrer-Policy": "unsafe-url"
},
}
try {
let { data: res } = await this.request(options);
$.log(`目前还剩【${res.point}】瓶 `)
} catch (e) {
console.log(e);
}
}
async run() {
await this.userInfo();
await this.addSign();
}
}
!(async () => {
await getNotice()
$.checkEnv(ckName);
for (let user of $.userList) {
//
await new Task(user).run();
}
})()
.catch((e) => console.log(e))
.finally(() => $.done());
async function getNotice() {
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}

View File

@ -208,7 +208,7 @@ class Task {
!(async () => {
await getNotice()
$.checkEnv(ckName);
if (process.env['wx_server_url'] && process.env['wx_auth']) {
if (process.env['wx_server_url'] && process.env['wx_auth'] && process.env['wx_app'].indexOf(ckName) !== -1) {
$.userList = ['test']
}
for (let user of $.userList) {

187
wxTemp/kekoukele.js Normal file
View File

@ -0,0 +1,187 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description:
cron: 30 9 * * 1
------------------------------------------
#Notice:
可口可乐 微信小程序 签到得积分
WeChatCodeServer 填写wx_server_url wx_auth 用于获取code
变量名称kekoukele
免责声明
------------------------------------------
1此脚本仅用于学习研究不保证其合法性准确性有效性请根据情况自行判断本人对此不承担任何保证责任
2由于此脚本仅用于学习研究您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除若违反规定引起任何事件本人对此均不负责
3请勿将此脚本用于任何商业或非法目的若违反规定请自行对此负责
4此脚本涉及应用与本人无关本人对因此引起的任何隐私泄漏或其他后果不承担任何责任
5本人对任何脚本引发的问题概不负责包括但不限于由脚本错误引起的任何损失和损害
6如果任何单位或个人认为此脚本可能涉嫌侵犯其权利应及时通知并提供身份证明所有权证明我们将在收到认证文件确认后删除此脚本
7所有直接或间接使用查看此脚本的人均应该仔细阅读此声明本人保留随时更改或补充此声明的权利一旦您使用或复制了此脚本即视为您已接受此免责声明
*/
const {
Env
} = require("../tools/env")
const $ = new Env("可口可乐小程序");
const WeChatCodeServer = require("wechat-mini-server");
let ckName = `kekoukele`;
const strSplitor = "#";
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"
let wechat = new WeChatCodeServer({
url: process.env.wx_server_url || 'http://192.168.31.196:12081',
appid: 'wxa5811e0426a94686',
auth: process.env.wx_auth || "your-api-key",
}
);
class Task {
constructor(env) {
this.index = $.userIdx++
this.user = env.split(strSplitor);
this.token = null
this.openid = null
this.isSign = false
}
async run() {
let { data: codeRes } = await wechat.GetMiniCode()
if (codeRes.status) {
await this.getUserToken(codeRes.data)
}
if (!this.token) {
$.log(`账号[${this.index}] 获取用户Token失败❌`)
return
}
await this.userInfo()
if (!this.isSign) await this.addSign()
}
async getUserToken(code) {
let options = {
method: 'GET',
url: 'https://member-api.icoke.cn/api/sp-portal/store/icoke/wechat/loginNoCache/' + code,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/50249',
'Accept': 'application/json, text/plain, */*',
'xweb_xhr': '1',
'Content-Type': 'application/json',
'Sec-Fetch-Site': 'cross-site',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://servicewechat.com/wxa5811e0426a94686/496/page-frame.html',
'Accept-Language': 'zh-CN,zh;q=0.9'
}
};
let {
data: result
} = await axios.request(options);
if (result?.jwtString) {
this.token = result?.jwtString
$.log(`🌸账号[${this.index}] 获取用户Token成功:${this.token}`)
} else {
$.log(`🌸账号[${this.index}] 获取用户Token-失败:${result.message}`)
}
}
async addSign() {
let options = {
method: "GET",
url: "https://member-api.icoke.cn/api/icoke-sign/icoke/mini/sign/main/sign",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "" + this.token,
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"xweb_xhr": "1",
"Referer": "https://servicewechat.com/wxa5811e0426a94686/421/page-frame.html",
"Referrer-Policy": "unsafe-url"
},
}
try {
let { data: res } = await axios.request(options);
if (res.success == true) {
$.log(`签到成功 获得【${res.point}】快乐瓶`)
} else {
$.log(`签到失败`)
console.log(res);
}
} catch (e) {
console.log(e);
}
}
async userInfo() {
let options = {
method: "GET",
url: "https://member-api.icoke.cn/api/icoke-customer/icoke/mini/customer/main/points",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "" + this.token,
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"xweb_xhr": "1",
"Referer": "https://servicewechat.com/wxa5811e0426a94686/421/page-frame.html",
"Referrer-Policy": "unsafe-url"
},
}
try {
let { data: res } = await axios.request(options);
$.log(`目前还剩【${res.point}】瓶 `)
} catch (e) {
console.log(e);
}
}
}
!(async () => {
await getNotice()
$.checkEnv(ckName);
if (process.env['wx_server_url'] && process.env['wx_auth'] && process.env['wx_app'].indexOf(ckName) !== -1 && process.env['wx_app'].indexOf(ckName) !== -1) {
$.userList = ['test']
}
for (let user of $.userList) {
await new Task(user).run();
}
})()
.catch((e) => console.log(e))
.finally(() => $.done());
async function getNotice() {
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout: 3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) { }
}

View File

@ -248,7 +248,7 @@ class Task {
!(async () => {
await getNotice()
$.checkEnv(ckName);
if (process.env['wx_server_url'] && process.env['wx_auth']) {
if (process.env['wx_server_url'] && process.env['wx_auth'] && process.env['wx_app'].indexOf(ckName) !== -1) {
$.userList = ['test']
}
for (let user of $.userList) {

View File

@ -167,7 +167,7 @@ class Task {
!(async () => {
await getNotice()
$.checkEnv(ckName);
if (process.env['wx_server_url'] && process.env['wx_auth']) {
if (process.env['wx_server_url'] && process.env['wx_auth'] && process.env['wx_app'].indexOf(ckName) !== -1) {
$.userList = ['test']
}
for (let user of $.userList) {

View File

@ -171,7 +171,7 @@ class Task {
!(async () => {
await getNotice()
$.checkEnv(ckName);
if (process.env['wx_server_url'] && process.env['wx_auth']) {
if (process.env['wx_server_url'] && process.env['wx_auth'] && process.env['wx_app'].indexOf(ckName) !== -1) {
$.userList = ['test']
}

View File

@ -164,7 +164,7 @@ class Task {
!(async () => {
await getNotice()
$.checkEnv(ckName);
if (process.env['wx_server_url'] && process.env['wx_auth']) {
if (process.env['wx_server_url'] && process.env['wx_auth'] && process.env['wx_app'].indexOf(ckName) !== -1) {
$.userList = ['test']
}
for (let user of $.userList) {