From edf5b3083ad627c1d5480684e2b0db4190038b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=B4=E5=A4=A9=E8=8E=AB=E7=88=B1=E5=B0=8F=E9=B8=9F?= <960365956@qq.com> Date: Thu, 15 Oct 2026 11:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=88=B1=E7=8E=9B=E4=BC=9A=E5=91=98=E4=BF=B1?= =?UTF-8?q?=E4=B9=90=E9=83=A8=EF=BC=9A=E7=AD=BE=E5=88=B0=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?ID=E6=94=B9=E4=B8=BA=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wxapp/aima.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/wxapp/aima.js b/wxapp/aima.js index 0984db9..c624dcf 100644 --- a/wxapp/aima.js +++ b/wxapp/aima.js @@ -12,7 +12,6 @@ const fs = require("fs"); const path = require("path"); // ================== 配置区 ================== -const ACTIVITY_ID = "100001275"; const BASE_URL = "https://scrm.aimatech.com"; const WXCLIENT_URL = `${BASE_URL}/aima/wxclient`; const MINI_APPID = "wx2dcfb409fd5ddfb4"; @@ -199,11 +198,31 @@ async function getAccessToken(account) { } // ================== 核心逻辑 ================== + async function signIn(account, index) { let token = await getAccessToken(account); const setToken = (newToken) => { token = newToken; }; + const searchLocations = await request( + "post", + `${WXCLIENT_URL}/mkt/activities/locations:search`, + token, + { + data: { "locations":[0,1,2] }, + account, + onToken: setToken, + } + ); + + if(searchLocations.status !== 200 || searchLocations.data?.code !== 200) { + throw new Error(`查询活动ID失败: HTTP ${searchLocations.status} ${JSON.stringify(searchLocations.data)}`); + } + var activityId = searchLocations.data?.content?.[0]?.activityId; + $.log(`🔎 账号【${index}】查询到活动ID: ${activityId || "未找到"}`); + if(!activityId) { + throw new Error(`未找到活动ID,请检查活动是否结束或账号是否有权限参与`); + } $.log(`🚀 账号【${index}】查询签到状态...`); const searchRes = await request( @@ -211,7 +230,7 @@ async function signIn(account, index) { `${WXCLIENT_URL}/mkt/activities/sign:search`, token, { - data: { activityId: ACTIVITY_ID }, + data: { activityId: activityId }, account, onToken: setToken, } @@ -233,7 +252,7 @@ async function signIn(account, index) { `${WXCLIENT_URL}/mkt/activities/sign:join`, token, { - data: { activityId: ACTIVITY_ID, activitySceneId: null }, + data: { activityId: activityId, activitySceneId: null }, account, onToken: setToken, }