(profile)
| 79 | } |
| 80 | |
| 81 | function buildCookie(profile) { |
| 82 | const commonid = profile.commonid || profile.openid; |
| 83 | const encodedNickname = encodeURIComponent(profile.nickname || ""); |
| 84 | const pairs = { |
| 85 | _gj_acc_type: 2, |
| 86 | _gj_commonid: commonid, |
| 87 | _gj_version: VERSION, |
| 88 | _gj_computername: COMPUTER_NAME, |
| 89 | _gj_client_guid: profile.guid, |
| 90 | _gj_server_guid: profile.serverGuid || "", |
| 91 | _gj_vip: profile.vip || 0, |
| 92 | _gj_nickname: profile.nickname || "", |
| 93 | _gj_accountid: profile.account, |
| 94 | _gj_loginkey: profile.loginKey, |
| 95 | _gj_openid: profile.openid, |
| 96 | _gj_sex: profile.sex || 0, |
| 97 | _gj_headimgurl: profile.headimgurl || "", |
| 98 | _gj_expired: 0, |
| 99 | _gj_support: "[0,1,2,3,4,5,6,8,10,11,12,13,14,15,18]", |
| 100 | _gj_encoded_nickname: encodedNickname, |
| 101 | _gj_level: profile.level || 0, |
| 102 | }; |
| 103 | return Object.entries(pairs) |
| 104 | .map(([key, value]) => `${key}=${cookieValue(value)}`) |
| 105 | .join("; "); |
| 106 | } |
| 107 | |
| 108 | async function getAuthCode(account) { |
| 109 | if (process.env.qqpcmgr_authCode) return process.env.qqpcmgr_authCode; |
no test coverage detected