* 分享
(artId)
| 459 | * 分享 |
| 460 | */ |
| 461 | async task_share(artId) { |
| 462 | try { |
| 463 | let YO = `${KO()}@DS@${KO()}`; |
| 464 | let key = YO.split("@DS@")[0]; |
| 465 | let iv = YO.split("@DS@")[1]; |
| 466 | /*console.log(YO); |
| 467 | log(key) |
| 468 | log(iv)*/ |
| 469 | let bodydata = { subjectId: artId, subjectType: "POST" }; |
| 470 | let options = { |
| 471 | url: `https://gw.nevapp.gtmc.com.cn/main/api/community/lgn/sec/user/forward`, |
| 472 | headers: this.getHeadersPost_h5(), |
| 473 | body: JSON.stringify({ |
| 474 | encryptKey: getRSAEncryptResult(YO), |
| 475 | encryptData: AES_CBC_Encrypt(bodydata, key, iv), |
| 476 | }), |
| 477 | }, |
| 478 | result = await httpRequest(options); |
| 479 | //console.log(options); |
| 480 | //console.log(result); |
| 481 | if ("encryptData" in result) { |
| 482 | let rsaDeData = result.encryptKey; |
| 483 | let rsaDeResult = getRSADecryptResult(rsaDeData); |
| 484 | let aesDeData = result.encryptData; |
| 485 | let aesDekey = rsaDeResult.split("@DS@")[0]; |
| 486 | let aesDeiv = rsaDeResult.split("@DS@")[1]; |
| 487 | let deResult = AES_CBC_Decrypt(aesDeData, aesDekey, aesDeiv); |
| 488 | if ((deResult.header.code = "10000000")) { |
| 489 | DoubleLog( |
| 490 | `账号[${this.index}] 分享文章: ${deResult.header.message}🎉` |
| 491 | ); |
| 492 | } else { |
| 493 | DoubleLog( |
| 494 | `账号[${this.index}] 分享文章: ${deResult.header.message}` |
| 495 | ); |
| 496 | } |
| 497 | } else { |
| 498 | DoubleLog(`账号[${this.index}] 分享文章:失败 ❌ 了呢,原因未知!`); |
| 499 | } |
| 500 | } catch (e) { |
| 501 | console.log(e); |
| 502 | } |
| 503 | } |
| 504 | /** |
| 505 | * 帖子列表 |
| 506 | * |
no test coverage detected