n/chit-chatu/leilakk_pei · 4 个月前
注册 登录
n/chit-chat · 4 个月前 · 968 次浏览
u/leilakk_pei白银

k12母号谷歌最新可用

83bec9de-395a-44e6-9a30-189508c22b99

19
26
登录后参与讨论。
海外原生IP VPS,稳定访问全球网络

还在为IP不纯、平台风控、频繁验证而烦恼? 丽萨主机海外原生IP VPS,双ISP住宅IP,覆盖美国、香港、日本、新加坡、台湾、德国、越南、英国等热门地区,适合跨境电商、社媒运营、AI工具、流媒体及海外业务使用。

lisahost.com 了解更多

26 条回复

排序
  1. html 黄金 4 个月前

    点赞支持分享

    原来还没有拉闸

    1
  2. leonxie 白银 4 个月前

    感谢分享,亲测可用喵

    1
  3. Ishan_Keshav 黄金 4 个月前

    Nice

    0
  4. Jiaming 黄金 4 个月前

    感谢感谢

    0
  5. zaclipsctest001 黄金 4 个月前

    还能用吗?

    0
  6. xingyun1000 黄金 4 个月前

    支持啊

    0
  7. Zhenhan 白银 4 个月前

    感谢大佬分享,又快乐的蹬起来了

    0
  8. Jay.C 黄金 3 YEARS 4 个月前

    感谢佬,天才程序员又复活了 :xhj41:

    0
  9. rustin123 白银 4 个月前

    thanks

    0
  10. Ezreal 白银 4 个月前

    确实可用

    0
  11. ll_dong 黄金 3 YEARS 4 个月前

    感谢分享

    0
  12. Opal 黄金 4 个月前

    感谢大佬分享

    0
  13. MengYYY369 黄金 3 YEARS 4 个月前

    感谢

    0
  14. le_vo 黄金 4 个月前

    thank you

    0
  15. jakefly 💬 黄金 4 个月前

    感谢大佬!想要outlook的哈哈哈哈哈,google账号太少了

    0
  16. Kami_Storage_One 白银 4 个月前

    Thank you

    0
  17. azhaoyihao 荣耀 水王 4 个月前

    感谢大佬分享

    0
  18. Jerry_tom 白银 3 YEARS 4 个月前

    感谢大佬的分享!牛皮

    0
  19. q97575314 钻石 3 YEARS 4 个月前

    很赞马上速蹬

    0
  20. uiop13 黄金 4 个月前

    感谢分享

    0
  21. PoBoModi 白银 4 个月前

    佬友们都是怎么发现的,太强了,有哪些渠道能找到吗

    0
  22. niuniu25 黄金 3 YEARS 4 个月前

    感谢,正好需要,已复活

    0
  23. niuniu25 黄金 3 YEARS 4 个月前

    没法使用 codex
    {"detail":{"message":"Unauthorized: Contact your ChatGPT workspace administrator for access.","code":"codex_workspace_access_denied"}}

    0
  24. jhon_xin 黄金 4 个月前

    感谢大佬

    0
  25. Aung_San 白银 4 个月前

    2340486e-nhvp42933ikxqdtw.js:61 Error: chatgpt_missing_subscription_billing_currency
    at CQe.mustGetSubscriptionBillingCurrency (4813494d-jnjn9ehsm4unmzfa.js:51:40203)
    at Kt (0aa79676-ppuh9x9ru13dfgcq.js:1:26610)
    at Zo (2340486e-nhvp42933ikxqdtw.js:8:48748)
    at Hc (2340486e-nhvp42933ikxqdtw.js:8:71428)
    at sl (2340486e-nhvp42933ikxqdtw.js:8:82079)
    at Gd (2340486e-nhvp42933ikxqdtw.js:8:126870)
    at Hd (2340486e-nhvp42933ikxqdtw.js:8:125933)
    at Vd (2340486e-nhvp42933ikxqdtw.js:8:125769)
    at Ad (2340486e-nhvp42933ikxqdtw.js:8:122048)
    at wf (2340486e-nhvp42933ikxqdtw.js:8:134772) Object
    Lu. @ 2340486e-nhvp42933ikxqdtw.js:61
    addError @ 4813494d-jnjn9ehsm4unmzfa.js:2
    mustGetSubscriptionBillingCurrency @ 4813494d-jnjn9ehsm4unmzfa.js:51
    Kt @ 0aa79676-ppuh9x9ru13dfgcq.js:1
    Zo @ 2340486e-nhvp42933ikxqdtw.js:8
    Hc @ 2340486e-nhvp42933ikxqdtw.js:8
    sl @ 2340486e-nhvp42933ikxqdtw.js:8
    Gd @ 2340486e-nhvp42933ikxqdtw.js:8
    Hd @ 2340486e-nhvp42933ikxqdtw.js:8
    Vd @ 2340486e-nhvp42933ikxqdtw.js:8
    Ad @ 2340486e-nhvp42933ikxqdtw.js:8
    wf @ 2340486e-nhvp42933ikxqdtw.js:8
    yf @ 2340486e-nhvp42933ikxqdtw.js:8
    $d @ 2340486e-nhvp42933ikxqdtw.js:8
    q @ 2340486e-nhvp42933ikxqdtw.js:8
    jd @ 2340486e-nhvp42933ikxqdtw.js:8
    Ad @ 2340486e-nhvp42933ikxqdtw.js:8
    Cf @ 2340486e-nhvp42933ikxqdtw.js:8
    ee @ 2340486e-nhvp42933ikxqdtw.js:1
    /backend-api/accounts/b49cd6d8-b52d-4c21-93d7-89cc19b5e18e/users/seat_type_counts:1 Failed to load resource: the server responded with a status of 401 ()
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:9 A router only supports one blocker at a time
    k @ 2340486e-nhvp42933ikxqdtw.js:9
    // ==UserScript==
    // @name ChatGPT Workspace Join Request
    // @namespace https://chatgpt.com/
    // @version 4.3.1
    // @description The child account automatically retrieves the AT (access token) of the currently logged-in account from /api/auth/session, and sends a join request or accepts an invite to the parent account's workspace. Only a workspace ID is needed; the UI can edit and save it.
    // @Author you
    // @match https://chatgpt.com/*
    // @run-at document-idle
    // @grant none
    // ==/UserScript==

    (function () {
    "use strict";

    // ===================== Default Config =====================
    const DEFAULTS = {
    workspaceIds: "83bec9de-395a-44e6-9a30-189508c22b99",
    intervalMs: 1500,
    maxRetries: 3,
    retryBackoffMs: 5000,
    sessionPollMs: 20000,
    panelWidth: 420,
    exportFormat: "cpa",
    };

    const STORE_KEY = "jr_config_v4";
    const PENDING_KEY = "jr_pending_effective_check_v4";
    const EFFECTIVE_KEY = "jr_effective_workspace_ids_v4";
    const ACCOUNT_SWITCH_KEY = "oai/apps/accountSwitchSessions";
    const EFFECTIVE_KEYWORD = "K12";
    function loadConfig() {
    let saved = {};
    try { saved = JSON.parse(localStorage.getItem(STORE_KEY) || "{}"); } catch () {}
    return Object.assign({}, DEFAULTS, saved);
    }
    function saveConfig(cfg) {
    try { localStorage.setItem(STORE_KEY, JSON.stringify(cfg)); } catch (
    ) {}
    }

    let CONFIG = loadConfig();

    // ---------- State ----------
    const STATE = {
    at: "",
    session: null,
    deviceId: crypto.randomUUID(),
    autoRan: false,
    running: false,
    };

    function parseJson(value, fallback) {
    try { return JSON.parse(value || ""); } catch (_) { return fallback; }
    }

    function getK12Workspace() {
    const sessions = parseJson(localStorage.getItem(ACCOUNT_SWITCH_KEY), []);
    for (const session of Array.isArray(sessions) ? sessions : []) {
    for (const ws of Array.isArray(session.workspaces) ? session.workspaces : []) {
    if (String(ws.workspaceName || "").includes(EFFECTIVE_KEYWORD)) return ws;
    }
    }
    return null;
    }

    async function waitForK12Workspace() {
    const end = Date.now() + 12000;
    let found = getK12Workspace();
    while (!found && Date.now() < end) {
    await sleep(1000);
    found = getK12Workspace();
    }
    return found;
    }

    function markEffectiveId(wsId, matched) {
    const list = parseJson(localStorage.getItem(EFFECTIVE_KEY), []);
    if (!list.some(item => item.workspaceId === wsId)) {
    list.push({
    workspaceId: wsId,
    matchedWorkspaceName: matched.workspaceName || "",
    matchedWorkspaceAccountId: matched.workspaceAccountId || "",
    at: new Date().toISOString(),
    });
    localStorage.setItem(EFFECTIVE_KEY, JSON.stringify(list));
    }
    }

    function savePendingCheck(pending) {
    localStorage.setItem(PENDING_KEY, JSON.stringify(pending));
    }

    function loadPendingCheck() {
    return parseJson(localStorage.getItem(PENDING_KEY), null);
    }

    function clearPendingCheck() {
    localStorage.removeItem(PENDING_KEY);
    }

    // ---------- /api/auth/session ----------
    async function fetchSession() {
    const res = await fetch("/api/auth/session", {
    headers: { accept: "/" },
    credentials: "include",
    });
    if (!res.ok) throw new Error(session HTTP ${res.status});
    return res.json();
    }

    function decodeJwt(at) {
    try {
    const p = at.split(".")[1];
    const j = JSON.parse(atob(p.replace(/-/g, "+").replace(//g, "/")));
    const auth = j["https://api.openai.com/auth"] || {};
    const prof = j["https://api.openai.com/profile"] || {};
    return {
    account_id: auth.chatgpt_account_id || "",
    email: prof.email || "",
    plan_type: auth.chatgpt_plan_type || "",
    exp: j.exp || 0,
    };
    } catch (
    ) { return {}; }
    }

    function base64UrlJson(value) {
    const bytes = new TextEncoder().encode(JSON.stringify(value));
    let binary = "";
    bytes.forEach(b => binary += String.fromCharCode(b));
    return btoa(binary).replace(/+/g, "-").replace(///g, "_").replace(/=+$/g, "");
    }

    function buildSyntheticIdToken(info) {
    if (!info.account_id) return "";
    const now = Math.trunc(Date.now() / 1000);
    const auth = { chatgpt_account_id: info.account_id };
    if (info.plan_type) auth.chatgpt_plan_type = info.plan_type;
    const payload = {
    iat: now,
    exp: info.exp || now + 90 * 24 * 60 * 60,
    email: info.email || undefined,
    "https://api.openai.com/auth": auth,
    };
    return ${base64UrlJson({ alg: "none", typ: "JWT", cpa_synthetic: true })}.${base64UrlJson(payload)}.synthetic;
    }

    function stripEmpty(value) {
    if (Array.isArray(value)) return value.map(stripEmpty).filter(v => v !== undefined);
    if (value && typeof value === "object") {
    const entries = Object.entries(value)
    .map(([k, v]) => [k, stripEmpty(v)])
    .filter(([, v]) => v !== undefined);
    return entries.length ? Object.fromEntries(entries) : undefined;
    }
    return value === undefined || value === null || value === "" ? undefined : value;
    }

    function toEmailKey(email) {
    return typeof email === "string"
    ? email.trim().toLowerCase().replace(/[^a-z0-9]+/g, "").replace(/^+|_+$/g, "")
    : undefined;
    }

    function getTokenInfo(session) {
    const accessToken = session.accessToken || "";
    if (!accessToken) throw new Error("Missing accessToken");
    const info = decodeJwt(accessToken);
    const expired = info.exp ? new Date(info.exp * 1000).toISOString() : undefined;
    const idToken = session.idToken || session.id_token || buildSyntheticIdToken(info);
    return {
    accessToken,
    accountId: info.account_id,
    email: info.email,
    name: info.email || "ChatGPT Account",
    planType: info.plan_type,
    idToken,
    idTokenSynthetic: !(session.idToken || session.id_token),
    refreshToken: session.refreshToken || session.refresh_token || "",
    sessionToken: session.sessionToken || session.session_token,
    lastRefresh: new Date().toISOString(),
    expired,
    expiresAt: info.exp || undefined,
    expiresIn: info.exp ? Math.max(0, info.exp - Math.trunc(Date.now() / 1000)) : undefined,
    };
    }

    function buildCpa(session) {
    const t = getTokenInfo(session);
    return stripEmpty({
    type: "codex",
    account_id: t.accountId,
    chatgpt_account_id: t.accountId,
    email: t.email,
    name: t.name,
    plan_type: t.planType,
    chatgpt_plan_type: t.planType,
    id_token: t.idToken,
    id_token_synthetic: t.idTokenSynthetic || undefined,
    access_token: t.accessToken,
    refresh_token: t.refreshToken,
    session_token: t.sessionToken,
    last_refresh: t.lastRefresh,
    expired: t.expired,
    });
    }

    function buildCockpit(session) {
    const t = getTokenInfo(session);
    return stripEmpty({
    type: "codex",
    id_token: t.idToken,
    access_token: t.accessToken,
    refresh_token: t.refreshToken,
    account_id: t.accountId,
    last_refresh: t.lastRefresh,
    email: t.email,
    expired: t.expired,
    });
    }

    function buildSub2api(session) {
    const t = getTokenInfo(session);
    return stripEmpty({
    version: 1,
    exported_at: t.lastRefresh,
    accounts: [{
    name: t.name,
    platform: "openai",
    type: "oauth",
    expires_at: t.expiresAt,
    auto_pause_on_expired: t.expiresAt ? true : undefined,
    concurrency: 10,
    priority: 1,
    credentials: {
    access_token: t.accessToken,
    chatgpt_account_id: t.accountId,
    email: t.email,
    expires_at: t.expired,
    expires_in: t.expiresIn,
    plan_type: t.planType,
    },
    extra: {
    email: t.email,
    email_key: toEmailKey(t.email),
    name: t.name,
    source: "chatgpt_web_session",
    last_refresh: t.lastRefresh,
    },
    }],
    });
    }

    function buildExport(session, format) {
    if (format === "sub2api") return buildSub2api(session);
    if (format === "cockpit") return buildCockpit(session);
    return buildCpa(session);
    }

    async function copyText(text) {
    if (navigator.clipboard?.writeText) {
    await navigator.clipboard.writeText(text);
    return;
    }
    const ta = document.createElement("textarea");
    ta.value = text;
    document.body.appendChild(ta);
    ta.select();
    document.execCommand("copy");
    ta.remove();
    }

    async function exportToken() {
    const format = exportFormatEl?.value || CONFIG.exportFormat || "cpa";
    try {
    const s = await fetchSession();
    STATE.session = s;
    STATE.at = s.accessToken || STATE.at;
    const text = JSON.stringify(buildExport(s, format), null, 2);
    if (exportOutputEl) exportOutputEl.value = text;
    await copyText(text);
    log(${format} generated and copied to clipboard, "ok");
    } catch (e) {
    log(${format} generation failed: ${e.message}, "err");
    }
    }

    function fmtExp(exp) {
    if (!exp) return "?";
    const min = Math.round((exp * 1000 - Date.now()) / 60000);
    if (min > 60) return Remaining ${Math.round(min/60)} hours;
    return Remaining ${min} minutes;
    }

    async function refreshSession() {
    try {
    const s = await fetchSession();
    const at = s.accessToken || "";
    if (at && at !== STATE.at) {
    STATE.at = at;
    STATE.session = s;
    const info = decodeJwt(at);
    log(Child account AT updated: ${info.email || "?"}, "ok");
    updateUserBar(info, "ok");
    onATReady();
    } else if (!at) {
    updateUserBar(null, "warn");
    }
    } catch (e) {
    log(session fetch failed: ${e.message}, "warn");
    updateUserBar(null, "err");
    }
    }

    // ---------- Sending Requests ----------
    async function sendOne(wsId, route, attempt) {
    attempt = attempt || 0;
    const url = /backend-api/accounts/${wsId}/invites/${route};
    const headers = {
    accept: "/",
    authorization: "Bearer " + STATE.at,
    "content-type": "application/json",
    "oai-device-id": STATE.deviceId,
    "oai-language": navigator.language || "en-US",
    };
    log(→ POST /accounts/${wsId.slice(0,8)}/invites/${route} (Attempt ${attempt+1}));
    try {
    const res = await fetch(url, {
    method: "POST", headers, body: "", mode: "cors", credentials: "include",
    });
    const text = await res.text();
    if (res.ok) {
    log(✓ ${wsId.slice(0,8)} HTTP ${res.status}: ${text}, "ok");
    return true;
    }
    log(✗ ${wsId.slice(0,8)} HTTP ${res.status}: ${text.slice(0,180)}, "warn");
    if (res.status === 401 || res.status === 403) {
    log("Child AT invalid, refreshing session...", "warn");
    STATE.at = "";
    await refreshSession();
    if (attempt < CONFIG.maxRetries) {
    await sleep(2000);
    return sendOne(wsId, route, attempt + 1);
    }
    return false;
    }
    if (attempt < CONFIG.maxRetries) {
    await sleep(CONFIG.retryBackoffMs * (attempt + 1));
    return sendOne(wsId, route, attempt + 1);
    }
    return false;
    } catch (e) {
    log(Network error: ${e.message}, "err");
    if (attempt < CONFIG.maxRetries) {
    await sleep(CONFIG.retryBackoffMs);
    return sendOne(wsId, route, attempt + 1);
    }
    return false;
    }
    }

    function parseWorkspaceIds() {
    return CONFIG.workspaceIds.split(/[\n,]+/).map(s => s.trim()).filter(Boolean);
    }

    async function continuePendingCheck() {
    const pending = loadPendingCheck();
    if (!pending) return false;

    STATE.autoRan = true;
    STATE.running = true;
    setBtns(false);
    log(`After refresh, checking if ${pending.candidateId.slice(0,8)} is effective...`, "info");
    
    const matched = await waitForK12Workspace();
    clearPendingCheck();
    if (matched) {
      markEffectiveId(pending.candidateId, matched);
      log(`Matched ${EFFECTIVE_KEYWORD}: ${matched.workspaceName}, effective ID: ${pending.candidateId}`, "ok");
      log("Stopped further workspace requests", "ok");
      STATE.running = false;
      setBtns(true);
      return true;
    }
    
    if (pending.nextIndex >= pending.ids.length) {
      log(`${pending.candidateId.slice(0,8)} did not find ${EFFECTIVE_KEYWORD}`, "warn");
    } else {
      log(`${pending.candidateId.slice(0,8)} did not find ${EFFECTIVE_KEYWORD}, continuing to next`, "warn");
    }
    STATE.running = false;
    await runAll(pending.route, pending.ids, pending.nextIndex, pending.ok);
    return true;
    

    }

    async function runAll(route, idsOverride, startIndex, okStart) {
    if (STATE.running) { log("Already running, please wait", "warn"); return; }
    if (!STATE.at) {
    log("No available AT, refreshing session...", "warn");
    await refreshSession();
    if (!STATE.at) { log("Still no AT detected, please login to chatgpt.com first", "err"); return; }
    }
    const ids = idsOverride || parseWorkspaceIds();
    if (!ids.length) { log("No workspace ID configured", "err"); return; }

    STATE.running = true;
    setBtns(false);
    const start = startIndex || 0;
    if (start >= ids.length) {
      log(`Check completed: API success ${okStart || 0}/${ids.length}, no effective ${EFFECTIVE_KEYWORD} ID detected`, "warn");
      STATE.running = false;
      setBtns(true);
      return;
    }
    log(`Processing ${ids.length - start} workspaces (${route})`, "info");
    let ok = okStart || 0;
    for (let i = start; i < ids.length; i++) {
      const ws = ids[i];
      const r = await sendOne(ws, route);
      if (r) {
        ok++;
        savePendingCheck({ route, ids, nextIndex: i + 1, ok, candidateId: ws });
        log("Request successful, refreshing page to check K12 workspace...", "ok");
        location.reload();
        return;
      }
      if (ids.length > 1) await sleep(CONFIG.intervalMs);
    }
    log(`API requests complete: success ${ok}/${ids.length}, no effective ${EFFECTIVE_KEYWORD} ID detected`, "warn");
    STATE.running = false;
    setBtns(true);
    

    }

    function onATReady() {
    if (!STATE.autoRan) {
    STATE.autoRan = true;
    runAll("request");
    }
    }

    function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }

    // ---------- UI ----------
    let panelBody, userBarEl, reqBtnEl, accBtnEl, exportBtnEl, exportFormatEl, exportOutputEl, wsInputEl, saveBtnEl, dirty = false;

    function setBtns(enabled) {
    [reqBtnEl, accBtnEl, exportBtnEl].forEach(b => {
    if (b) { b.disabled = !enabled; b.style.opacity = enabled ? "1" : "0.5"; }
    });
    }

    function updateUserBar(info, status) {
    if (!userBarEl) return;
    const c = { ok: "#2f855a", warn: "#b7791f", err: "#c53030" };
    if (info && info.email) {
    userBarEl.innerHTML =
    <span style="color:${c.ok}">●</span> <b>${info.email}</b> · ${info.plan_type||"?"} · +
    <code style="background:#edf2f7;padding:1px 4px;border-radius:3px">${(info.account_id||"").slice(0,8)}</code> · +
    <span style="color:#718096">${fmtExp(info.exp)}</span>;
    } else {
    const msg = status === "err" ? "Session fetch failed, please make sure you’re logged in" : "No AT detected, waiting for login...";
    userBarEl.innerHTML = <span style="color:${c[status]||c.warn}">●</span> ${msg};
    }
    }

    function markDirty() {
    dirty = true;
    if (saveBtnEl) {
    saveBtnEl.textContent = "Save *";
    saveBtnEl.style.background = "#d69e2e";
    saveBtnEl.style.color = "#fff";
    }
    }

    function markClean() {
    dirty = false;
    if (saveBtnEl) {
    saveBtnEl.textContent = "Saved";
    saveBtnEl.style.background = "#38a169";
    saveBtnEl.style.color = "#fff";
    }
    setTimeout(() => {
    if (!dirty && saveBtnEl) {
    saveBtnEl.textContent = "Save";
    saveBtnEl.style.background = "#edf2f7";
    saveBtnEl.style.color = "#4a5568";
    }
    }, 1500);
    }

    function buildPanel() {
    const css = .jr-panel{position:fixed;top:14px;right:14px;width:${CONFIG.panelWidth}px; background:#fff;border:1px solid #e2e8f0;border-radius:14px; box-shadow:0 12px 32px rgba(0,0,0,.16);z-index:99999; font:13px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#1a202c;overflow:hidden} .jr-head{padding:11px 16px;background:linear-gradient(135deg,#3182ce,#2b6cb0);color:#fff; display:flex;justify-content:space-between;align-items:center} .jr-title{font-weight:600;font-size:13px;letter-spacing:.3px;display:flex;align-items:center;gap:6px} .jr-title svg{width:16px;height:16px;fill:#fff} .jr-ver{font-size:11px;opacity:.85;background:rgba(255,255,255,.2);padding:1px 6px;border-radius:8px} .jr-sub{padding:9px 16px;background:#f7fafc;border-bottom:1px solid #edf2f7;font-size:12px;color:#4a5568;min-height:22px} .jr-sec{padding:12px 16px;border-bottom:1px solid #edf2f7} .jr-label{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#718096; margin-bottom:6px;font-weight:600;letter-spacing:.4px;text-transform:uppercase} .jr-label .jr-count{font-size:10px;color:#a0aec0;font-weight:400;text-transform:none;letter-spacing:0} .jr-ta{width:100%;box-sizing:border-box;border:1px solid #e2e8f0;border-radius:8px; padding:8px 10px;font:12px/1.5 monospace;color:#2d3748;background:#fff;transition:.15s;min-height:64px;resize:vertical} .jr-out{width:100%;box-sizing:border-box;border:1px solid #e2e8f0;border-radius:8px; padding:8px 10px;font:11px/1.45 monospace;color:#2d3748;background:#f8fafc;min-height:90px;resize:vertical} .jr-select{border:1px solid #e2e8f0;border-radius:7px;background:#fff;color:#2d3748;padding:6px 8px;font-size:12px} .jr-export-row{display:flex;gap:8px;align-items:center;margin-bottom:8px} .jr-export-row .jr-select{flex:1} .jr-ta:focus{outline:0;border-color:#3182ce;box-shadow:0 0 0 3px rgba(49,130,206,.12)} .jr-save-row{display:flex;justify-content:flex-end;margin-top:8px} .jr-body{padding:10px 16px;max-height:36vh;overflow:auto} .jr-foot{padding:10px 16px;border-top:1px solid #edf2f7;display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap} .jr-line{padding:3px 0;word-break:break-all;border-bottom:1px dashed #f1f5f9} .jr-line:last-child{border-bottom:0} .jr-info{color:#2b6cb0}.jr-ok{color:#2f855a}.jr-warn{color:#b7791f}.jr-err{color:#c53030} .jr-btn{cursor:pointer;border:0;border-radius:7px;padding:7px 14px;font-size:12px;font-weight:500;transition:.15s} .jr-btn-primary{background:#3182ce;color:#fff}.jr-btn-primary:hover{background:#2b6cb0} .jr-btn-green{background:#38a169;color:#fff}.jr-btn-green:hover{background:#2f855a} .jr-btn-ghost{background:#edf2f7;color:#4a5568}.jr-btn-ghost:hover{background:#e2e8f0} .jr-btn:disabled{cursor:not-allowed;opacity:.5} .jr-hint{font-size:11px;color:#a0aec0;padding:6px 0 0 0;line-height:1.5};
    const style = document.createElement("style");
    style.textContent = css;
    document.head.appendChild(style);

    const p = document.createElement("div");
    p.className = "jr-panel";
    p.innerHTML = `
      <div class="jr-head">
        <span class="jr-title">
          <svg viewBox="0 0 24 24"><path d="M15 4l6 6-10 10H5v-6L15 4zm-1 1L7 12l5 5 7-7-5-5z"/></svg>
          Workspace Join Request
        </span>
        <span class="jr-ver">v4.3</span>
      </div>
      <div class="jr-sub" id="jr-user">No AT detected, waiting for login...</div>
    
      <div class="jr-sec">
        <label class="jr-label">
          <span>Parent Workspace ID</span>
          <span class="jr-count" id="jr-count">0 items</span>
        </label>
        <textarea class="jr-ta" id="jr-ws" placeholder="One UUID per line&#10;acfb4e38-524c-4dc8-b4cf-fb3d0ce28b25"></textarea>
        <div class="jr-save-row">
          <button class="jr-btn jr-btn-ghost" id="jr-save" style="padding:5px 14px">Save</button>
        </div>
        <div class="jr-hint">Only child AT + workspace ID needed. request = actively apply to join; accept = accept an existing invite.</div>
      </div>
    
      <div class="jr-body" id="jr-body"></div>
    
      <div class="jr-sec">
        <label class="jr-label"><span>Token Conversion</span><span>Auto Copy</span></label>
        <div class="jr-export-row">
          <select class="jr-select" id="jr-export-format">
            <option value="cpa">CPA</option>
            <option value="sub2api">sub2api</option>
            <option value="cockpit">Cockpit</option>
          </select>
          <button class="jr-btn jr-btn-ghost" id="jr-export">Convert</button>
        </div>
        <textarea class="jr-out" id="jr-export-output" readonly placeholder="Select a format then click 'Convert'"></textarea>
      </div>
    
      <div class="jr-foot">
        <button class="jr-btn jr-btn-ghost" id="jr-refresh">Refresh AT</button>
        <button class="jr-btn jr-btn-green" id="jr-accept">Accept</button>
        <button class="jr-btn jr-btn-primary" id="jr-run">Request</button>
      </div>
    `;
    document.body.appendChild(p);
    
    panelBody = p.querySelector("#jr-body");
    userBarEl = p.querySelector("#jr-user");
    reqBtnEl = p.querySelector("#jr-run");
    accBtnEl = p.querySelector("#jr-accept");
    exportBtnEl = p.querySelector("#jr-export");
    exportFormatEl = p.querySelector("#jr-export-format");
    exportOutputEl = p.querySelector("#jr-export-output");
    wsInputEl = p.querySelector("#jr-ws");
    saveBtnEl = p.querySelector("#jr-save");
    const countEl = p.querySelector("#jr-count");
    
    // Fill in saved values
    wsInputEl.value = CONFIG.workspaceIds;
    const updateCount = () => {
      const n = wsInputEl.value.split(/[\n,]+/).map(s=>s.trim()).filter(Boolean).length;
      countEl.textContent = `${n} items`;
    };
    updateCount();
    
    // Mark as dirty when editing
    wsInputEl.addEventListener("input", () => {
      markDirty();
      updateCount();
    });
    
    // Save
    saveBtnEl.addEventListener("click", () => {
      CONFIG.workspaceIds = wsInputEl.value;
      saveConfig(CONFIG);
      markClean();
      log("Workspace saved", "ok");
    });
    
    // Buttons
    reqBtnEl.addEventListener("click", () => runAll("request"));
    accBtnEl.addEventListener("click", () => runAll("accept"));
    exportFormatEl.value = CONFIG.exportFormat || "cpa";
    exportFormatEl.addEventListener("change", () => {
      CONFIG.exportFormat = exportFormatEl.value;
      saveConfig(CONFIG);
    });
    exportBtnEl.addEventListener("click", exportToken);
    p.querySelector("#jr-refresh").addEventListener("click", async () => {
      log("Manually refreshing session...", "info");
      await refreshSession();
    });
    

    }

    function log(msg, level) {
    const styles = { info: "jr-info", ok: "jr-ok", warn: "jr-warn", err: "jr-err" };
    const time = new Date().toLocaleTimeString();
    console.log("%c[JoinReq]", "color:#3182ce;font-weight:bold", msg);
    if (panelBody) {
    const line = document.createElement("div");
    line.className = jr-line ${styles[level] || "jr-info"};
    line.textContent = [${time}] ${msg};
    panelBody.appendChild(line);
    panelBody.scrollTop = panelBody.scrollHeight;
    }
    }

    // ---------- Boot ----------
    function boot() {
    buildPanel();
    log("Script loaded v4.3", "info");
    log("Only child AT + workspace ID needed", "info");
    log("request = apply · accept = accept invite", "info");
    continuePendingCheck().then(resumed => { if (!resumed) refreshSession(); });
    setInterval(refreshSession, CONFIG.sessionPollMs);
    window.addEventListener("focus", () => { if (!STATE.running) refreshSession(); });
    }

    if (document.readyState === "loading") {
    document.addEventListener("DOMContentLoaded", boot);
    } else {
    boot();
    }
    })();
    VM1508:628 [JoinReq] Script loaded v4.3
    VM1508:628 [JoinReq] Only child AT + workspace ID needed
    VM1508:628 [JoinReq] request = apply · accept = accept invite
    VM1508:628 [JoinReq] After refresh, checking if 83bec9de is effective...
    undefined
    VM1508:628 [JoinReq] Workspace saved
    VM1508:628 [JoinReq] 83bec9de did not find K12
    VM1508:628 [JoinReq] No available AT, refreshing session...
    VM1508:628 [JoinReq] Child account AT updated: [email protected]
    VM1508:628 [JoinReq] Check completed: API success 1/1, no effective K12 ID detected
    VM1508:628 [JoinReq] Workspace saved
    VM1508:628 [JoinReq] cpa generated and copied to clipboard
    2340486e-nhvp42933ikxqdtw.js:61 Error: chatgpt_missing_subscription_billing_currency
    at CQe.mustGetSubscriptionBillingCurrency (4813494d-jnjn9ehsm4unmzfa.js:51:40203)
    at Kt (0aa79676-ppuh9x9ru13dfgcq.js:1:26610)
    at Zo (2340486e-nhvp42933ikxqdtw.js:8:48748)
    at Hc (2340486e-nhvp42933ikxqdtw.js:8:71428)
    at sl (2340486e-nhvp42933ikxqdtw.js:8:82079)
    at Gd (2340486e-nhvp42933ikxqdtw.js:8:126870)
    at Hd (2340486e-nhvp42933ikxqdtw.js:8:125933)
    at Vd (2340486e-nhvp42933ikxqdtw.js:8:125769)
    at Ad (2340486e-nhvp42933ikxqdtw.js:8:122048)
    at wf (2340486e-nhvp42933ikxqdtw.js:8:134772) {callLocation: 'DeactivatedWorkspaceMenuItem'}
    Lu. @ 2340486e-nhvp42933ikxqdtw.js:61
    addError @ 4813494d-jnjn9ehsm4unmzfa.js:2
    mustGetSubscriptionBillingCurrency @ 4813494d-jnjn9ehsm4unmzfa.js:51
    Kt @ 0aa79676-ppuh9x9ru13dfgcq.js:1
    Zo @ 2340486e-nhvp42933ikxqdtw.js:8
    Hc @ 2340486e-nhvp42933ikxqdtw.js:8
    sl @ 2340486e-nhvp42933ikxqdtw.js:8
    Gd @ 2340486e-nhvp42933ikxqdtw.js:8
    Hd @ 2340486e-nhvp42933ikxqdtw.js:8
    Vd @ 2340486e-nhvp42933ikxqdtw.js:8
    Ad @ 2340486e-nhvp42933ikxqdtw.js:8
    wf @ 2340486e-nhvp42933ikxqdtw.js:8
    yf @ 2340486e-nhvp42933ikxqdtw.js:8
    $d @ 2340486e-nhvp42933ikxqdtw.js:8
    q @ 2340486e-nhvp42933ikxqdtw.js:8
    jd @ 2340486e-nhvp42933ikxqdtw.js:8
    Ad @ 2340486e-nhvp42933ikxqdtw.js:8
    Cf @ 2340486e-nhvp42933ikxqdtw.js:8
    ee @ 2340486e-nhvp42933ikxqdtw.js:1
    postMessage
    D @ 2340486e-nhvp42933ikxqdtw.js:1
    e.unstable_scheduleCallback @ 2340486e-nhvp42933ikxqdtw.js:1
    Sf @ 2340486e-nhvp42933ikxqdtw.js:8
    xf @ 2340486e-nhvp42933ikxqdtw.js:8
    (anonymous) @ 2340486e-nhvp42933ikxqdtw.js:8
    setTimeout
    (anonymous) @ 4813494d-jnjn9ehsm4unmzfa.js:250
    (anonymous) @ 4813494d-jnjn9ehsm4unmzfa.js:250
    (anonymous) @ 4813494d-jnjn9ehsm4unmzfa.js:160
    (anonymous) @ 4813494d-jnjn9ehsm4unmzfa.js:160
    Pf @ 2340486e-nhvp42933ikxqdtw.js:8
    (anonymous) @ 2340486e-nhvp42933ikxqdtw.js:8
    On @ 2340486e-nhvp42933ikxqdtw.js:8
    zf @ 2340486e-nhvp42933ikxqdtw.js:8
    eh @ 2340486e-nhvp42933ikxqdtw.js:9
    $m @ 2340486e-nhvp42933ikxqdtw.js:9
    2340486e-nhvp42933ikxqdtw.js:61 Error: chatgpt_missing_subscription_billing_currency
    at CQe.mustGetSubscriptionBillingCurrency (4813494d-jnjn9ehsm4unmzfa.js:51:40203)
    at Kt (0aa79676-ppuh9x9ru13dfgcq.js:1:26610)
    at Zo (2340486e-nhvp42933ikxqdtw.js:8:48748)
    at Hc (2340486e-nhvp42933ikxqdtw.js:8:71428)
    at sl (2340486e-nhvp42933ikxqdtw.js:8:82079)
    at Gd (2340486e-nhvp42933ikxqdtw.js:8:126870)
    at Hd (2340486e-nhvp42933ikxqdtw.js:8:125933)
    at Vd (2340486e-nhvp42933ikxqdtw.js:8:125769)
    at Ad (2340486e-nhvp42933ikxqdtw.js:8:122048)
    at wf (2340486e-nhvp42933ikxqdtw.js:8:134772) {callLocation: 'DeactivatedWorkspaceMenuItem'}
    Lu. @ 2340486e-nhvp42933ikxqdtw.js:61
    addError @ 4813494d-jnjn9ehsm4unmzfa.js:2
    mustGetSubscriptionBillingCurrency @ 4813494d-jnjn9ehsm4unmzfa.js:51
    Kt @ 0aa79676-ppuh9x9ru13dfgcq.js:1
    Zo @ 2340486e-nhvp42933ikxqdtw.js:8
    Hc @ 2340486e-nhvp42933ikxqdtw.js:8
    sl @ 2340486e-nhvp42933ikxqdtw.js:8
    Gd @ 2340486e-nhvp42933ikxqdtw.js:8
    Hd @ 2340486e-nhvp42933ikxqdtw.js:8
    Vd @ 2340486e-nhvp42933ikxqdtw.js:8
    Ad @ 2340486e-nhvp42933ikxqdtw.js:8
    wf @ 2340486e-nhvp42933ikxqdtw.js:8
    yf @ 2340486e-nhvp42933ikxqdtw.js:8
    $d @ 2340486e-nhvp42933ikxqdtw.js:8
    q @ 2340486e-nhvp42933ikxqdtw.js:8
    jd @ 2340486e-nhvp42933ikxqdtw.js:8
    Ad @ 2340486e-nhvp42933ikxqdtw.js:8
    Cf @ 2340486e-nhvp42933ikxqdtw.js:8
    ee @ 2340486e-nhvp42933ikxqdtw.js:1
    postMessage
    D @ 2340486e-nhvp42933ikxqdtw.js:1
    e.unstable_scheduleCallback @ 2340486e-nhvp42933ikxqdtw.js:1
    Sf @ 2340486e-nhvp42933ikxqdtw.js:8
    xf @ 2340486e-nhvp42933ikxqdtw.js:8
    (anonymous) @ 2340486e-nhvp42933ikxqdtw.js:8
    setTimeout
    (anonymous) @ 4813494d-jnjn9ehsm4unmzfa.js:250
    (anonymous) @ 4813494d-jnjn9ehsm4unmzfa.js:250
    (anonymous) @ 4813494d-jnjn9ehsm4unmzfa.js:160
    (anonymous) @ 4813494d-jnjn9ehsm4unmzfa.js:160
    Pf @ 2340486e-nhvp42933ikxqdtw.js:8
    (anonymous) @ 2340486e-nhvp42933ikxqdtw.js:8
    On @ 2340486e-nhvp42933ikxqdtw.js:8
    zf @ 2340486e-nhvp42933ikxqdtw.js:8
    eh @ 2340486e-nhvp42933ikxqdtw.js:9
    $m @ 2340486e-nhvp42933ikxqdtw.js:9
    chat gpt k12 deactivate error

    0
  26. XXWJT 白银 4 个月前

    行吗!

    0