(authCode, guid)
| 159 | } |
| 160 | |
| 161 | async function loginByCode(authCode, guid) { |
| 162 | const { data } = await axios.request({ |
| 163 | method: "POST", |
| 164 | url: "https://jprx.m.qq.com/data/3078/forward", |
| 165 | headers: { |
| 166 | "User-Agent": USER_AGENT, |
| 167 | Accept: "application/json, text/plain, */*", |
| 168 | "Content-Type": "application/json", |
| 169 | "sec-ch-ua": '"Chromium";v="109"', |
| 170 | "sec-ch-ua-mobile": "?0", |
| 171 | "sec-ch-ua-platform": '"Windows"', |
| 172 | Origin: "https://webcdn.m.qq.com", |
| 173 | "Sec-Fetch-Site": "same-site", |
| 174 | "Sec-Fetch-Mode": "cors", |
| 175 | "Sec-Fetch-Dest": "empty", |
| 176 | Referer: "https://webcdn.m.qq.com/", |
| 177 | "Accept-Language": "zh-CN,zh;q=0.9", |
| 178 | }, |
| 179 | data: { |
| 180 | req: { |
| 181 | platType: 3, |
| 182 | loginAccType: 32, |
| 183 | authCode, |
| 184 | clientGuid: guid, |
| 185 | }, |
| 186 | }, |
| 187 | timeout: 20000, |
| 188 | validateStatus: () => true, |
| 189 | }); |
| 190 | const payload = findLoginPayload(data); |
| 191 | if (!payload) throw new Error(`登录响应未找到 loginKey/openid: ${JSON.stringify(data)}`); |
| 192 | return payload; |
| 193 | } |
| 194 | |
| 195 | function normalizeProfile(payload, guid) { |
| 196 | const third = payload.thirdPartyAccInfo || {}; |
no test coverage detected