{"id":132,"date":"2026-05-16T01:24:28","date_gmt":"2026-05-16T01:24:28","guid":{"rendered":"https:\/\/www.51baoziwen.com\/?page_id=132"},"modified":"2026-05-16T01:38:54","modified_gmt":"2026-05-16T01:38:54","slug":"codex-oauth-automation","status":"publish","type":"page","link":"https:\/\/www.51baoziwen.com\/?page_id=132","title":{"rendered":"Codex OAuth Automation"},"content":{"rendered":"<h1>Codex OAuth Automation<\/h1>\n<p>\u8fd9\u662f\u4e00\u4e2a\u4e13\u7528\u5165\u53e3\u9875\u9762\uff0c\u7528\u4e8e\u8bbf\u95ee Codex OAuth Automation \u76f8\u5173\u529f\u80fd\u3001\u8bf4\u660e\u4e0e\u5bfc\u822a\u3002<\/p>\n<h2>\u9875\u9762\u5b9a\u4f4d<\/h2>\n<ul>\n<li>\u672c\u9875\u9762\u4f4d\u4e8e WordPress \u4e2d\uff0c\u4f5c\u4e3a\u72ec\u7acb\u65b0\u7f51\u9875\u4f7f\u7528\u3002<\/li>\n<li>\u9875\u9762\u8d1f\u8d23\u5c55\u793a\u8bf4\u660e\u3001\u5165\u53e3\u548c\u8df3\u8f6c\u3002<\/li>\n<li>\u5b9e\u9645\u6267\u884c\u4f9d\u8d56\u5bbf\u4e3b\u673a\u6d4f\u89c8\u5668\u6269\u5c55\u4e0e\u540e\u7aef\u670d\u52a1\u3002<\/li>\n<\/ul>\n<h2>\u5e38\u7528\u5165\u53e3<\/h2>\n<ul>\n<li><a href=\"\/?page_id=120\">CLI Proxy API Plus \u767b\u5f55<\/a><\/li>\n<li><a href=\"\/?page_id=121\">New API \u767b\u5f55<\/a><\/li>\n<li><a href=\"\/?page_id=59\">Sub2API \u767b\u5f55<\/a><\/li>\n<li><a href=\"\/?page_id=122\">Wenfxl Codex Manager \u767b\u5f55<\/a><\/li>\n<li><a href=\"\/?page_id=117\">WordPress \u540e\u53f0<\/a><\/li>\n<li><a href=\"\/?page_id=118\">\u5b9d\u5854\u9762\u677f\u767b\u5f55<\/a><\/li>\n<\/ul>\n<h2>\u63d2\u4ef6\u8c03\u7528<\/h2>\n<p>\u4e0b\u9762\u7684\u63a7\u5236\u533a\u7528\u4e8e\u8c03\u7528\u5bbf\u4e3b\u673a\u4e0a\u7684 Codex OAuth Automation \u8fd0\u884c\u5b9e\u4f8b\u3002<\/p>\n<div id=\"codex-bridge-panel\" style=\"border:1px solid #ddd;padding:16px;border-radius:12px;background:#fafafa;max-width:760px\">\n<p><strong>\u8fd0\u884c\u72b6\u6001\uff1a<\/strong> <span id=\"codex-status-text\">\u68c0\u6d4b\u4e2d&#8230;<\/span><\/p>\n<p><strong>\u5f53\u524d\u8282\u70b9\uff1a<\/strong> <span id=\"codex-current-node\">&#8211;<\/span><\/p>\n<p><strong>\u6ce8\u518c\u90ae\u7bb1\uff1a<\/strong> <span id=\"codex-email\">&#8211;<\/span><\/p>\n<div style=\"gap:12px;flex-wrap:wrap;margin:12px 0\">\n    <button id=\"codex-refresh-btn\" type=\"button\">\u5237\u65b0\u72b6\u6001<\/button><br \/>\n    <button id=\"codex-open-btn\" type=\"button\">\u6253\u5f00\u63d2\u4ef6\u9875<\/button><br \/>\n    <button id=\"codex-start-btn\" type=\"button\">\u542f\u52a8 1 \u8f6e\u81ea\u52a8\u6d41\u7a0b<\/button>\n  <\/div>\n<p id=\"codex-bridge-msg\" style=\"color:#555;margin:8px 0 0\">\n<\/div>\n<p>(async function(){<br \/>\n  const statusText = document.getElementById(&#8216;codex-status-text&#8217;);<br \/>\n  const currentNode = document.getElementById(&#8216;codex-current-node&#8217;);<br \/>\n  const emailText = document.getElementById(&#8216;codex-email&#8217;);<br \/>\n  const msg = document.getElementById(&#8216;codex-bridge-msg&#8217;);<br \/>\n  const refreshBtn = document.getElementById(&#8216;codex-refresh-btn&#8217;);<br \/>\n  const openBtn = document.getElementById(&#8216;codex-open-btn&#8217;);<br \/>\n  const startBtn = document.getElementById(&#8216;codex-start-btn&#8217;);<\/p>\n<p>  async function call(path, method=&#8217;GET&#8217;, body=null) {<br \/>\n    const res = await fetch(&#8216;\/wp-admin\/admin-ajax.php?action=codex_bridge_proxy&amp;route=&#8217; + encodeURIComponent(path), {<br \/>\n      method,<br \/>\n      headers: body ? {&#8216;Content-Type&#8217;:&#8217;application\/json&#8217;} : {},<br \/>\n      body: body ? JSON.stringify(body) : null,<br \/>\n      credentials: &#8216;same-origin&#8217;<br \/>\n    });<br \/>\n    return await res.json();<br \/>\n  }<\/p>\n<p>  async function refreshStatus() {<br \/>\n    statusText.textContent = &#8216;\u68c0\u6d4b\u4e2d&#8230;&#8217;;<br \/>\n    try {<br \/>\n      const data = await call(&#8216;\/status&#8217;);<br \/>\n      if (!data || data.success === false) throw new Error(data &amp;&amp; (data.data?.error || data.error) || &#8216;\u72b6\u6001\u83b7\u53d6\u5931\u8d25&#8217;);<br \/>\n      const payload = data.data || data;<br \/>\n      statusText.textContent = payload.ok ? &#8216;\u5728\u7ebf&#8217; : &#8216;\u5f02\u5e38&#8217;;<br \/>\n      currentNode.textContent = payload.currentNodeId || &#8216;-&#8216;;<br \/>\n      emailText.textContent = payload.email || &#8216;-&#8216;;<br \/>\n      msg.textContent = &#8216;\u72b6\u6001\u5df2\u5237\u65b0&#8217;;<br \/>\n    } catch (e) {<br \/>\n      statusText.textContent = &#8216;\u4e0d\u53ef\u7528&#8217;;<br \/>\n      msg.textContent = e.message || &#8216;\u72b6\u6001\u83b7\u53d6\u5931\u8d25&#8217;;<br \/>\n    }<br \/>\n  }<\/p>\n<p>  refreshBtn.addEventListener(&#8216;click&#8217;, refreshStatus);<br \/>\n  openBtn.addEventListener(&#8216;click&#8217;, async () =&gt; {<br \/>\n    msg.textContent = &#8216;\u6b63\u5728\u6253\u5f00\u63d2\u4ef6\u9875&#8230;&#8217;;<br \/>\n    try {<br \/>\n      const data = await call(&#8216;\/open&#8217;, &#8216;POST&#8217;, {});<br \/>\n      if (!data || data.success === false) throw new Error(data &amp;&amp; (data.data?.error || data.error) || &#8216;\u6253\u5f00\u5931\u8d25&#8217;);<br \/>\n      msg.textContent = &#8216;\u5df2\u8bf7\u6c42\u6253\u5f00\u63d2\u4ef6\u9875&#8217;;<br \/>\n    } catch (e) {<br \/>\n      msg.textContent = e.message || &#8216;\u6253\u5f00\u5931\u8d25&#8217;;<br \/>\n    }<br \/>\n  });<br \/>\n  startBtn.addEventListener(&#8216;click&#8217;, async () =&gt; {<br \/>\n    msg.textContent = &#8216;\u6b63\u5728\u542f\u52a8&#8230;&#8217;;<br \/>\n    try {<br \/>\n      const data = await call(&#8216;\/start&#8217;, &#8216;POST&#8217;, { totalRuns: 1 });<br \/>\n      if (!data || data.success === false) throw new Error(data &amp;&amp; (data.data?.error || data.error) || &#8216;\u542f\u52a8\u5931\u8d25&#8217;);<br \/>\n      msg.textContent = &#8216;\u5df2\u53d1\u9001\u542f\u52a8\u8bf7\u6c42&#8217;;<br \/>\n      setTimeout(refreshStatus, 1500);<br \/>\n    } catch (e) {<br \/>\n      msg.textContent = e.message || &#8216;\u542f\u52a8\u5931\u8d25&#8217;;<br \/>\n    }<br \/>\n  });<br \/>\n  refreshStatus();<br \/>\n})();<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Codex OAuth Automation \u8fd9\u662f\u4e00\u4e2a\u4e13\u7528\u5165\u53e3\u9875\u9762\uff0c\u7528\u4e8e\u8bbf\u95ee Codex OAuth Auto [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-132","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.51baoziwen.com\/index.php?rest_route=\/wp\/v2\/pages\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.51baoziwen.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.51baoziwen.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.51baoziwen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.51baoziwen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=132"}],"version-history":[{"count":1,"href":"https:\/\/www.51baoziwen.com\/index.php?rest_route=\/wp\/v2\/pages\/132\/revisions"}],"predecessor-version":[{"id":133,"href":"https:\/\/www.51baoziwen.com\/index.php?rest_route=\/wp\/v2\/pages\/132\/revisions\/133"}],"wp:attachment":[{"href":"https:\/\/www.51baoziwen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}