已经更换 大佬提供ID ff598c4d-ccaf-40c1-bfaa-cb94565764b1
https://www.nodeloc.com/t/topic/97549?sort=top
fetch("https://chatgpt.com/api/auth/session", {
method: "GET",
credentials: "include"
})
.then(response => response.json())
.then(sessionData => {
const accessToken = sessionData.accessToken;
if (!accessToken) {
throw new Error("未能获取到 accessToken");
}
console.log("获取到 accessToken,正在发送邀请请求...");
return fetch("https://chatgpt.com/backend-api/accounts/ff598c4d-ccaf-40c1-bfaa-cb94565764b1/invites/request", {
method: "POST",
headers: {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9",
"authorization": `Bearer ${accessToken}`, // ← 这里使用了正确的反引号
"cache-control": "no-cache",
"oai-language": "en-US",
"pragma": "no-cache",
"sec-ch-ua-arch": "\"x86\"",
"sec-ch-ua-bitness": "\"64\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-model": "\"\"",
"sec-ch-ua-platform": "\"macOS\"",
"sec-ch-ua-platform-version": "\"13.5.1\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
referrer: "https://chatgpt.com/k12-verification",
referrerPolicy: "strict-origin-when-cross-origin",
body: null,
mode: "cors",
credentials: "include"
});
})
.then(response => response.json())
.then(result => {
console.log("邀请请求成功:", result);
})
.catch(error => {
console.error("请求失败:", error);
});
4
10
10 risposte
Ordinamento