Skip to content

Commit 14f5461

Browse files
Update
1 parent 589438a commit 14f5461

File tree

2 files changed

+58
-45
lines changed

2 files changed

+58
-45
lines changed

jd_tewu.js

+48-41
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ var TS_USER_AGENTS_1 = require("./TS_USER_AGENTS");
5454
var cookie = '', UserName = '', res = '', message = '', shareCodes = [], shareCodesSelf = [], shareCodesHW = [];
5555
!(function () { return __awaiter(void 0, void 0, void 0, function () {
5656
var cookiesArr, activityId, _i, _a, _b, index, value, encryptProjectId, _c, _d, t, tp, sum, userStarNum, i, full, _e, _f, _g, index, value, mine, _h, _j, t, _loop_1, _k, shareCodes_1, code, state_1;
57-
var _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
58-
return __generator(this, function (_2) {
59-
switch (_2.label) {
57+
var _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
58+
return __generator(this, function (_3) {
59+
switch (_3.label) {
6060
case 0: return [4 /*yield*/, (0, TS_USER_AGENTS_1.requireConfig)()];
6161
case 1:
62-
cookiesArr = _2.sent();
62+
cookiesArr = _3.sent();
6363
_i = 0, _a = cookiesArr.entries();
64-
_2.label = 2;
64+
_3.label = 2;
6565
case 2:
6666
if (!(_i < _a.length)) return [3 /*break*/, 25];
6767
_b = _a[_i], index = _b[0], value = _b[1];
@@ -70,21 +70,27 @@ var cookie = '', UserName = '', res = '', message = '', shareCodes = [], shareCo
7070
console.log("\n\u5F00\u59CB\u3010\u4EAC\u4E1C\u8D26\u53F7".concat(index + 1, "\u3011").concat(UserName, "\n"));
7171
return [4 /*yield*/, api('showSecondFloorCardInfo', { "source": "secondfloor" })];
7272
case 3:
73-
res = _2.sent();
74-
activityId = res.data.result.activityBaseInfo.activityId;
73+
res = _3.sent();
74+
try {
75+
activityId = res.data.result.activityBaseInfo.activityId;
76+
}
77+
catch (e) {
78+
console.log('黑号');
79+
return [3 /*break*/, 24];
80+
}
7581
encryptProjectId = res.data.result.activityBaseInfo.encryptProjectId;
7682
return [4 /*yield*/, (0, TS_USER_AGENTS_1.wait)(1000)
7783
// 任务
7884
];
7985
case 4:
80-
_2.sent();
86+
_3.sent();
8187
return [4 /*yield*/, api('superBrandTaskList', { "source": "secondfloor", "activityId": activityId, "assistInfoFlag": 1 })];
8288
case 5:
8389
// 任务
84-
res = _2.sent();
90+
res = _3.sent();
8591
(0, TS_USER_AGENTS_1.o2s)(res);
8692
_c = 0, _d = res.data.result.taskList;
87-
_2.label = 6;
93+
_3.label = 6;
8894
case 6:
8995
if (!(_c < _d.length)) return [3 /*break*/, 15];
9096
t = _d[_c];
@@ -95,27 +101,27 @@ var cookie = '', UserName = '', res = '', message = '', shareCodes = [], shareCo
95101
console.log(tp.title || tp.shopName, tp.itemId);
96102
return [4 /*yield*/, api('superBrandDoTask', { "source": "secondfloor", "activityId": activityId, "encryptProjectId": encryptProjectId, "encryptAssignmentId": t.encryptAssignmentId, "assignmentType": t.assignmentType, "itemId": tp.itemId, "actionType": 0 })];
97103
case 7:
98-
res = _2.sent();
104+
res = _3.sent();
99105
console.log((_q = res.data) === null || _q === void 0 ? void 0 : _q.bizMsg);
100106
return [4 /*yield*/, (0, TS_USER_AGENTS_1.wait)(2000)];
101107
case 8:
102-
_2.sent();
103-
_2.label = 9;
108+
_3.sent();
109+
_3.label = 9;
104110
case 9:
105111
if (!((_r = t.ext) === null || _r === void 0 ? void 0 : _r.sign2)) return [3 /*break*/, 13];
106112
if (!(t.ext.currentSectionStatus !== 1)) return [3 /*break*/, 12];
107113
return [4 /*yield*/, api('superBrandDoTask', { "source": "secondfloor", "activityId": activityId, "encryptProjectId": encryptProjectId, "encryptAssignmentId": t.encryptAssignmentId, "assignmentType": t.assignmentType, "itemId": t.ext.currentSectionItemId, "actionType": 0 })];
108114
case 10:
109-
res = _2.sent();
115+
res = _3.sent();
110116
console.log((_s = res.data) === null || _s === void 0 ? void 0 : _s.bizMsg);
111117
return [4 /*yield*/, (0, TS_USER_AGENTS_1.wait)(2000)];
112118
case 11:
113-
_2.sent();
119+
_3.sent();
114120
console.log('下拉任务', (_t = t.ext) === null || _t === void 0 ? void 0 : _t.sign2);
115121
return [3 /*break*/, 13];
116122
case 12:
117123
console.log('下拉任务 已经完成');
118-
_2.label = 13;
124+
_3.label = 13;
119125
case 13:
120126
// 助力码
121127
if ((_u = t.ext) === null || _u === void 0 ? void 0 : _u.assistTaskDetail) {
@@ -128,7 +134,7 @@ var cookie = '', UserName = '', res = '', message = '', shareCodes = [], shareCo
128134
itemId: t.ext.assistTaskDetail.itemId
129135
});
130136
}
131-
_2.label = 14;
137+
_3.label = 14;
132138
case 14:
133139
_c++;
134140
return [3 /*break*/, 6];
@@ -137,16 +143,16 @@ var cookie = '', UserName = '', res = '', message = '', shareCodes = [], shareCo
137143
sum = 0;
138144
return [4 /*yield*/, api('superBrandSecondFloorMainPage', { "source": "secondfloor" })];
139145
case 16:
140-
res = _2.sent();
146+
res = _3.sent();
141147
userStarNum = res.data.result.activityUserInfo.userStarNum;
142148
console.log('可以抽奖', userStarNum, '次');
143149
i = 0;
144-
_2.label = 17;
150+
_3.label = 17;
145151
case 17:
146152
if (!(i < userStarNum)) return [3 /*break*/, 21];
147153
return [4 /*yield*/, api('superBrandTaskLottery', { "source": "secondfloor", "activityId": activityId })];
148154
case 18:
149-
res = _2.sent();
155+
res = _3.sent();
150156
if ((_0 = (_z = (_y = res.data.result) === null || _y === void 0 ? void 0 : _y.rewardComponent) === null || _z === void 0 ? void 0 : _z.beanList) === null || _0 === void 0 ? void 0 : _0.length) {
151157
console.log('抽奖获得京豆:', res.data.result.rewardComponent.beanList[0].quantity);
152158
sum += res.data.result.rewardComponent.beanList[0].quantity;
@@ -156,53 +162,57 @@ var cookie = '', UserName = '', res = '', message = '', shareCodes = [], shareCo
156162
}
157163
return [4 /*yield*/, (0, TS_USER_AGENTS_1.wait)(2000)];
158164
case 19:
159-
_2.sent();
160-
_2.label = 20;
165+
_3.sent();
166+
_3.label = 20;
161167
case 20:
162168
i++;
163169
return [3 /*break*/, 17];
164170
case 21:
165171
message += "\u3010\u4EAC\u4E1C\u8D26\u53F7".concat(index + 1, "\u3011").concat(UserName, "\n\u62BD\u5956").concat(userStarNum, "\u6B21\uFF0C\u83B7\u5F97\u4EAC\u8C46").concat(sum, "\n\n");
166-
_2.label = 22;
172+
_3.label = 22;
167173
case 22: return [4 /*yield*/, (0, TS_USER_AGENTS_1.wait)(2000)];
168174
case 23:
169-
_2.sent();
170-
_2.label = 24;
175+
_3.sent();
176+
_3.label = 24;
171177
case 24:
172178
_i++;
173179
return [3 /*break*/, 2];
174180
case 25:
175181
console.log(shareCodesSelf);
176182
return [4 /*yield*/, (0, TS_USER_AGENTS_1.getshareCodeHW)('tewu')];
177183
case 26:
178-
shareCodesHW = _2.sent();
184+
shareCodesHW = _3.sent();
179185
shareCodes = __spreadArray(__spreadArray([], shareCodesSelf, true), shareCodesHW, true);
180186
full = [];
181187
_e = 0, _f = cookiesArr.entries();
182-
_2.label = 27;
188+
_3.label = 27;
183189
case 27:
184190
if (!(_e < _f.length)) return [3 /*break*/, 33];
185191
_g = _f[_e], index = _g[0], value = _g[1];
186192
cookie = value;
187193
return [4 /*yield*/, api('superBrandTaskList', { "source": "secondfloor", "activityId": activityId, "assistInfoFlag": 1 })];
188194
case 28:
189-
res = _2.sent();
195+
res = _3.sent();
190196
mine = '';
197+
if (!((_1 = res.data.result) === null || _1 === void 0 ? void 0 : _1.taskList)) {
198+
console.log('黑号');
199+
return [3 /*break*/, 32];
200+
}
191201
for (_h = 0, _j = res.data.result.taskList; _h < _j.length; _h++) {
192202
t = _j[_h];
193-
if ((_1 = t.ext) === null || _1 === void 0 ? void 0 : _1.assistTaskDetail) {
203+
if ((_2 = t.ext) === null || _2 === void 0 ? void 0 : _2.assistTaskDetail) {
194204
mine = t.ext.assistTaskDetail.itemId;
195205
}
196206
}
197207
_loop_1 = function (code) {
198-
return __generator(this, function (_3) {
199-
switch (_3.label) {
208+
return __generator(this, function (_4) {
209+
switch (_4.label) {
200210
case 0:
201211
if (!(code.itemId !== mine && !full.includes(code.itemId))) return [3 /*break*/, 3];
202212
console.log("\u8D26\u53F7".concat(index + 1, " \u53BB\u52A9\u529B ").concat(code.itemId, " ").concat(shareCodesSelf.some(function (self) { return self.itemId === code.itemId; }) ? '*内部*' : ''));
203213
return [4 /*yield*/, api('superBrandDoTask', { "source": "secondfloor", "activityId": code.activityId, "encryptProjectId": code.encryptProjectId, "encryptAssignmentId": code.encryptAssignmentId, "assignmentType": 2, "itemId": code.itemId, "actionType": 0 })];
204214
case 1:
205-
res = _3.sent();
215+
res = _4.sent();
206216
if (res.data.bizCode === '0') {
207217
console.log('助力成功');
208218
}
@@ -223,26 +233,23 @@ var cookie = '', UserName = '', res = '', message = '', shareCodes = [], shareCo
223233
}
224234
return [4 /*yield*/, (0, TS_USER_AGENTS_1.wait)(2000)];
225235
case 2:
226-
_3.sent();
227-
return [3 /*break*/, 4];
228-
case 3:
229-
console.log('助力满了,跳过');
230-
_3.label = 4;
231-
case 4: return [2 /*return*/];
236+
_4.sent();
237+
_4.label = 3;
238+
case 3: return [2 /*return*/];
232239
}
233240
});
234241
};
235242
_k = 0, shareCodes_1 = shareCodes;
236-
_2.label = 29;
243+
_3.label = 29;
237244
case 29:
238245
if (!(_k < shareCodes_1.length)) return [3 /*break*/, 32];
239246
code = shareCodes_1[_k];
240247
return [5 /*yield**/, _loop_1(code)];
241248
case 30:
242-
state_1 = _2.sent();
249+
state_1 = _3.sent();
243250
if (state_1 === "break")
244251
return [3 /*break*/, 32];
245-
_2.label = 31;
252+
_3.label = 31;
246253
case 31:
247254
_k++;
248255
return [3 /*break*/, 29];

jd_tewu.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ let cookie: string = '', UserName: string = '', res: any = '', message: string =
2525
console.log(`\n开始【京东账号${index + 1}${UserName}\n`)
2626

2727
res = await api('showSecondFloorCardInfo', {"source": "secondfloor"})
28-
29-
activityId = res.data.result.activityBaseInfo.activityId
28+
try {
29+
activityId = res.data.result.activityBaseInfo.activityId
30+
} catch (e) {
31+
console.log('黑号')
32+
continue
33+
}
3034
let encryptProjectId: string = res.data.result.activityBaseInfo.encryptProjectId
3135
await wait(1000)
3236

@@ -101,6 +105,10 @@ let cookie: string = '', UserName: string = '', res: any = '', message: string =
101105
cookie = value
102106
res = await api('superBrandTaskList', {"source": "secondfloor", "activityId": activityId, "assistInfoFlag": 1})
103107
let mine: string = ''
108+
if (!res.data.result?.taskList) {
109+
console.log('黑号')
110+
continue
111+
}
104112
for (let t of res.data.result.taskList) {
105113
if (t.ext?.assistTaskDetail) {
106114
mine = t.ext.assistTaskDetail.itemId
@@ -125,8 +133,6 @@ let cookie: string = '', UserName: string = '', res: any = '', message: string =
125133
console.log('其他错误', res.data.bizMsg)
126134
}
127135
await wait(2000)
128-
} else {
129-
console.log('助力满了,跳过')
130136
}
131137
}
132138
}

0 commit comments

Comments
 (0)