{"id":548879,"date":"2021-12-27T18:41:14","date_gmt":"2021-12-27T10:41:14","guid":{"rendered":"http:\/\/4563.org\/?p=548879"},"modified":"2021-12-27T18:41:14","modified_gmt":"2021-12-27T10:41:14","slug":"%e8%b7%aa%e6%b1%82wp%e7%bd%91%e7%ab%99%e7%ad%be%e5%88%b0%e6%a8%a1%e6%9d%bf%e3%80%82","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=548879","title":{"rendered":"\u8dea\u6c42WP\u7f51\u7ad9\u7b7e\u5230\u6a21\u677f\u3002"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>JoannaEva<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u8dea\u6c42WP\u7f51\u7ad9\u7b7e\u5230\u6a21\u677f\u3002<\/h3>\n<p>  \t\t\u81ea\u52a8\u7b7e\u5230\u6a21\u677f\uff0cWP\u5e94\u8be5\u662f\u901a\u7528\u7684\uff0c\u6362\u4e00\u4e2a\u7f51\u7ad9\u5730\u5740\u5c31\u56e0\u8be5\u80fd\u901a\u7528\uff0c<\/p>\n<p>  \u770b\u4e86\u51e0\u4e2aWP\u7f51\u7ad9<\/p>\n<p>  Post \u7684\u5730\u5740\u90fd\u662f https:\/\/xxxx.com\/wp-json\/b2\/v1\/userMission\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>JoannaEva<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u81ea\u5df1\u5199\u4e86\u4e00\u4e2a\u5206\u4eab\u7ed9\u5927\u5bb6\uff0c<\/p>\n<p>  const $ = new Env(&#8216;xxx\u6bcf\u65e5\u7b7e\u5230&#8217;);<\/p>\n<p>  go();<\/p>\n<p>  async function go () {<br \/>  await sign();<br \/>  }<\/p>\n<p>  function sign () {<br \/>  return new Promise(resolve =&gt; {<br \/>  &nbsp; &nbsp; let req = {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;url: `https:\/\/xxxx.com\/wp-json\/b2\/v1\/userMission`,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;headers: {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;accept&quot;: &quot;&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;accept-language&quot;: &quot;&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;use-agent&quot;&quot;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ \u66f4\u591a\u7684\u4fe1\u606f\u81ea\u5df1\u6293\u5305\u8865\u5145<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;},<br \/>  &nbsp; &nbsp; }<br \/>  &nbsp; &nbsp; $.post(req, async (err, resp, data) =&gt; {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;try {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;if (err) {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; console.log(`${JSON.stringify(err)}`)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;} else {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; console.log(`${data}`)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;} catch (e) {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;$.logErr(e, resp)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;} finally {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;resolve();<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  &nbsp; &nbsp; })<br \/>  })<br \/>  }\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u8759\u8760\u4fa0<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\twp\u7b7e\u5230\u6709\u4ec0\u4e48\u7528\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>JoannaEva \u5927\u4f6c\u6709\u8bdd\u8bf4 :&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/548879"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=548879"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/548879\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=548879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=548879"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=548879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}