| 258 | } |
| 259 | |
| 260 | async handleReadTask() { |
| 261 | $.log("🔍 获取文章列表..."); |
| 262 | const articleRes = await this.request( |
| 263 | "GET", |
| 264 | `/qualcomm-app/api/home/articles?page=1&size=10&userId=${this.userId}&type=0&searchDate=&articleShowPlace=骁友资讯列表页` |
| 265 | ); |
| 266 | |
| 267 | if (articleRes.code === 200 && articleRes.data?.articleList?.length) { |
| 268 | const article = articleRes.data.articleList[0]; |
| 269 | $.log(`📖 开始阅读: ${article.title.substring(0, 20)}...`); |
| 270 | |
| 271 | const enterRes = await this.request("POST", |
| 272 | "/qualcomm-app/api/article/enterReadDaily", |
| 273 | `articleId=${article.id}&userId=${this.userId}` |
| 274 | ); |
| 275 | |
| 276 | if (enterRes.code !== 200) { |
| 277 | $.log(`⚠️ 进入阅读失败: ${enterRes.message}`); |
| 278 | } |
| 279 | |
| 280 | const likeRes = await this.request("GET", |
| 281 | `/qualcomm-app/api/article/like?articleId=${article.id}&userId=${this.userId}` |
| 282 | ); |
| 283 | |
| 284 | if (likeRes.code === 200) { |
| 285 | $.log("👍 点赞成功"); |
| 286 | } else { |
| 287 | $.log(`⚠️ 点赞失败: ${likeRes.message}`); |
| 288 | } |
| 289 | |
| 290 | const shareRes = await this.request("POST", |
| 291 | "/qualcomm-app/api/article/shareDaily", |
| 292 | `articleId=${article.id}&userId=${this.userId}` |
| 293 | ); |
| 294 | |
| 295 | if (shareRes.code === 200) { |
| 296 | $.log("🔗 分享成功"); |
| 297 | } else { |
| 298 | $.log(`⚠️ 分享失败: ${shareRes.message}`); |
| 299 | } |
| 300 | |
| 301 | $.log("⏳ 模拟阅读65秒..."); |
| 302 | await $.wait(65000); |
| 303 | |
| 304 | const exitRes = await this.request("POST", |
| 305 | "/qualcomm-app/api/article/exitReadDaily", |
| 306 | `articleId=${article.id}&userId=${this.userId}` |
| 307 | ); |
| 308 | |
| 309 | if (exitRes.code === 200) { |
| 310 | $.log("✅ 阅读任务完成"); |
| 311 | } else { |
| 312 | $.log(`⚠️ 退出阅读失败: ${exitRes.message}`); |
| 313 | } |
| 314 | } else { |
| 315 | $.log("ℹ️ 未获取到文章,跳过阅读任务"); |
| 316 | } |
| 317 | } |