{"id":339293,"date":"2021-02-14T00:58:16","date_gmt":"2021-02-13T16:58:16","guid":{"rendered":"http:\/\/4563.org\/?p=339293"},"modified":"2021-02-14T00:58:16","modified_gmt":"2021-02-13T16:58:16","slug":"cf%e7%89%88server%e9%85%b1%ef%bc%8cby%e4%bc%81%e4%b8%9a%e5%be%ae%e4%bf%a1%e9%80%9a%e9%81%93","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=339293","title":{"rendered":"CF\u7248Server\u9171\uff0cby\u4f01\u4e1a\u5fae\u4fe1\u901a\u9053"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>arron<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>CF\u7248Server\u9171\uff0cby\u4f01\u4e1a\u5fae\u4fe1\u901a\u9053<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 arron \u4e8e 2021-2-13 17:16 \u7f16\u8f91 <\/p>\n<p> \u5728Hostloc\u4e0a\u770b\u4e86mjj\u7684\u5e16\u5b50- MJJ\u4e13\u7528server\u9171 \u4f01\u4e1a\u5fae\u4fe1\u901a\u9053PHP\u7248\uff08https:\/\/www.hostloc.com\/thread-806295-1-1.html\uff09\uff0c\u611f\u89c9\u6574\u4e00\u4e2a\u81ea\u5df1\u7684\u6d88\u606f\u63a8\u9001\u7684\u670d\u52a1\u4e5f\u4e0d\u9519\uff0c\u4e0d\u8fc7\u5bf9\u4e8e\u559c\u6b22\u6298\uff08\u767d\uff09\u817e\uff08\u7968\uff09\u7684\u6211\uff0c\u8fd8\u662f\u5e0c\u671b\u4f7f\u7528cf\u7684workers\u6765\u505a\u3002<\/p>\n<p>  \u6587\u7ae0\u9996\u53d1\u5728\u6211\u7684\u535a\u5ba2\u4e0a\uff08\u76fc\u671bIp+1\uff09\uff1ahttps:\/\/blog.arrontg.cf\/article\/000007\/.html<\/p>\n<p>  \u6ce8\u518c\u4f01\u4e1a\u5fae\u4fe1<br \/>  \u7b2c\u4e00\u6b65\u5462\u8981\u5148\u6ce8\u518c\u4f01\u4e1a\u5fae\u4fe1\uff0c\u6211\u4eec\u76f4\u63a5\u770bserver\u9171\u7684\u6559\u7a0b\uff0c\u8bb0\u4e0b\u6559\u7a0b\u91cc\u7684\u5e94\u7528ID( agentid )\uff0c\u5e94\u7528Secret( secret )\uff0c\u4f01\u4e1aID\u3002<br \/>  \u539f\u8d34\u5927\u4f6c\u628a\u6559\u7a0b\u590d\u5236\u5230\u77f3\u58a8\u4e86\uff0cserver\u9171\u7684\u8fd8\u9700\u8981\u767b\u5f55\u624d\u80fd\u770b\uff1ahttps:\/\/shimo.im\/docs\/38dpjtwWtRRVQ6Wy<\/p>\n<p>  \u5728CF\u4e0a\u521b\u5efaworkers<br \/>  \u8fd9\u91cc\u53ea\u63d0\u4f9b\u4e86\u5361\u7247\u6d88\u606f\u4e00\u79cd\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u53c2\u8003\u4f01\u4e1a\u5fae\u4fe1\u7684api\u6587\u6863\uff1ahttps:\/\/work.weixin.qq.com\/api\/doc\/90000\/90135\/90236<\/p>\n<p>  \u8bbf\u95ee\u65f6\u5e26\u4e0a\u53c2\u6570\u5c31\u884c\u5566\uff0c<br \/>  \u7b80\u5355\u70b9\uff1ahttp:\/\/xxx.workers.dev\/?msg=xxx<br \/>  \u590d\u6742\u70b9\uff1ahttp:\/\/xxx.workers.dev\/?title=xxx&amp;description=xxx&amp;url=xxx<br \/>  \u5176\u4e2d<br \/>  title : \u6d88\u606ftitle\uff0c\u9ed8\u8ba4\u201cServer\u9171\u901a\u77e5\u201d<br \/>  description : \u6d88\u606f\u5185\u5bb9\uff0c\u9ed8\u8ba4\u201c\u901a\u77e5\u5185\u5bb9\u201d<br \/>  url : \u8df3\u8f6c\u5730\u5740\uff0c\u9ed8\u8ba4\u201cURL\u201d<\/p>\n<p>  workers\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>  \/\/\u6559\u7a0b\uff1ahttps:\/\/shimo.im\/docs\/38dpjtwWtRRVQ6Wy\/read<br \/>  const OPT = {<br \/>  corpid : &#8221;,\/\/\u4f01\u4e1aid<br \/>  agentid:&#8221;,\/\/\u5e94\u7528id<br \/>  corpsecret:&#8221;, \/\/\u5e94\u7528secret<\/p>\n<p>  access_token:undefined<br \/>  }<\/p>\n<p>  addEventListener(&#8216;fetch&#8217;, event =&gt; {<br \/>  event.respondWith(handleRequest(event.request))<br \/>  })<\/p>\n<p>  \/**<br \/>   * Respond to the request<br \/>   * @param {Request} request<br \/>   *\/<br \/>  async function handleRequest(request) {<br \/>  let url = new URL(request.url);<br \/>  \/\/\u6d88\u606ftitle<br \/>  let title = url.searchParams.get(&#8216;title&#8217;)||&quot;Server\u9171\u901a\u77e5&quot;;<br \/>  \/\/\u6d88\u606f\u5185\u5bb9<br \/>  let description = url.searchParams.get(&#8216;description&#8217;)||url.searchParams.get(&#8216;msg&#8217;)||&quot;\u901a\u77e5\u5185\u5bb9&quot;;<br \/>  \/\/\u8df3\u8f6c\u5730\u5740<br \/>  let jumpUrl = url.searchParams.get(&#8216;url&#8217;)||&quot;URL&quot;;<\/p>\n<p>  \/\/\u83b7\u53d6access_token\uff0c\u5199\u5165OPT\u4e2d<br \/>  let msg = await getAccessToken();<br \/>  if(msg.errcode){<br \/>  &nbsp; &nbsp; return new Response(JSON.stringify(msg), {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;status: 200, <br \/>  &nbsp; &nbsp;&nbsp; &nbsp;headers:{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&#8216;content-type&#8217;:&#8217;application\/json; charset=UTF-8&#8242;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  &nbsp; &nbsp; })<br \/>  }<\/p>\n<p>  \/\/\u53d1\u9001\u6d88\u606f<br \/>  return await pushMsg(title, description, jumpUrl);<br \/>  }<\/p>\n<p>  \/\/\u83b7\u53d6access_token\uff0c\u5199\u5165OPT\u4e2d<br \/>  async function getAccessToken(){<br \/>  let result = await fetch(&quot;https:\/\/qyapi.weixin.qq.com\/cgi-bin\/gettoken?corpid=&quot;+OPT.corpid+&quot;&amp;corpsecret=&quot;+OPT.corpsecret);<br \/>  let json = await result.json();<br \/>  console.log(json)<br \/>  if(json.errcode==0){<br \/>  &nbsp; &nbsp; OPT.access_token = json.access_token<br \/>  }<br \/>  return json<br \/>  }<\/p>\n<p>  \/\/\u53d1\u9001\u6d88\u606f<br \/>  async function pushMsg(title, description,url=&quot;URL&quot;,btntxt=&quot;\u66f4\u591a&quot;){<br \/>  let body = {<br \/>  &nbsp; &nbsp; \/**<br \/>  &nbsp; &nbsp;* \u6307\u5b9a\u63a5\u6536\u6d88\u606f\u7684\u6210\u5458\uff0c\u6210\u5458ID\u5217\u8868\uff08\u591a\u4e2a\u63a5\u6536\u8005\u7528\u2018|\u2019\u5206\u9694\uff0c\u6700\u591a\u652f\u63011000\u4e2a\uff09\u3002<br \/>  &nbsp; &nbsp;* \u7279\u6b8a\u60c5\u51b5\uff1a\u6307\u5b9a\u4e3a\u201d@all\u201d\uff0c\u5219\u5411\u8be5\u4f01\u4e1a\u5e94\u7528\u7684\u5168\u90e8\u6210\u5458\u53d1\u9001<br \/>  &nbsp; &nbsp;*\/<br \/>  &nbsp; &nbsp; &quot;touser&quot; : &quot;@all&quot;,\/\/\u975e\u5fc5\u987b\uff0c\u4f46touser\u3001toparty\u3001totag\u4e0d\u80fd\u540c\u65f6\u4e3a\u7a7a\uff0c\u540e\u9762\u4e0d\u518d\u5f3a\u8c03\u3002<br \/>  &nbsp; &nbsp; \/**<br \/>  &nbsp; &nbsp;* \u6307\u5b9a\u63a5\u6536\u6d88\u606f\u7684\u90e8\u95e8\uff0c\u90e8\u95e8ID\u5217\u8868\uff0c\u591a\u4e2a\u63a5\u6536\u8005\u7528\u2018|\u2019\u5206\u9694\uff0c\u6700\u591a\u652f\u6301100\u4e2a\u3002<br \/>  &nbsp; &nbsp;* \u5f53touser\u4e3a\u201d@all\u201d\u65f6\u5ffd\u7565\u672c\u53c2\u6570<br \/>  &nbsp; &nbsp;*\/<br \/>  &nbsp; &nbsp; \/\/&quot;toparty&quot; : &quot;PartyID1|PartyID2&quot;,\/\/\u975e\u5fc5\u987b<br \/>  &nbsp; &nbsp; \/**<br \/>  &nbsp; &nbsp;* \u6307\u5b9a\u63a5\u6536\u6d88\u606f\u7684\u6807\u7b7e\uff0c\u6807\u7b7eID\u5217\u8868\uff0c\u591a\u4e2a\u63a5\u6536\u8005\u7528\u2018|\u2019\u5206\u9694\uff0c\u6700\u591a\u652f\u6301100\u4e2a\u3002<br \/>  &nbsp; &nbsp;* \u5f53touser\u4e3a\u201d@all\u201d\u65f6\u5ffd\u7565\u672c\u53c2\u6570<br \/>  &nbsp; &nbsp;*\/<br \/>  &nbsp; &nbsp; \/\/&quot;totag&quot; : &quot;TagID1 | TagID2&quot;,\/\/\u975e\u5fc5\u987b<br \/>  &nbsp; &nbsp; &quot;msgtype&quot; : &quot;textcard&quot;,\/\/\u5fc5\u987b\uff0c\u6d88\u606f\u7c7b\u578b\uff0c\u6b64\u65f6\u56fa\u5b9a\u4e3a\uff1atextcard<br \/>  &nbsp; &nbsp; &quot;agentid&quot; : OPT.agentid,\/\/\u4f01\u4e1a\u5e94\u7528\u7684id\uff0c\u6574\u578b\u3002\u4f01\u4e1a\u5185\u90e8\u5f00\u53d1\uff0c\u53ef\u5728\u5e94\u7528\u7684\u8bbe\u7f6e\u9875\u9762\u67e5\u770b\uff1b\u7b2c\u4e09\u65b9\u670d\u52a1\u5546\uff0c\u53ef\u901a\u8fc7\u63a5\u53e3 \u83b7\u53d6\u4f01\u4e1a\u6388\u6743\u4fe1\u606f \u83b7\u53d6\u8be5\u53c2\u6570\u503c<br \/>  &nbsp; &nbsp; &quot;textcard&quot; : {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;title&quot; : title,\/\/\u5fc5\u987b\uff0c\u6807\u9898\uff0c\u4e0d\u8d85\u8fc7128\u4e2a\u5b57\u8282\uff0c\u8d85\u8fc7\u4f1a\u81ea\u52a8\u622a\u65ad\uff08\u652f\u6301id\u8f6c\u8bd1\uff09<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;description&quot; : description, \/\/\u5fc5\u987b\uff0c\u6d88\u606f\u5185\u5bb9\uff0c\u6700\u957f\u4e0d\u8d85\u8fc72048\u4e2a\u5b57\u8282\uff0c\u8d85\u8fc7\u5c06\u622a\u65ad\uff08\u652f\u6301id\u8f6c\u8bd1\uff09<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;url&quot;: url,\/\/\u70b9\u51fb\u540e\u8df3\u8f6c\u7684\u94fe\u63a5\u3002\u6700\u957f2048\u5b57\u8282\uff0c\u8bf7\u786e\u4fdd\u5305\u542b\u4e86\u534f\u8bae\u5934(http\/https)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;btntxt&quot;:btntxt \/\/\u975e\u5fc5\u987b\uff0c\u6309\u94ae\u6587\u5b57\u3002 \u9ed8\u8ba4\u4e3a\u201c\u8be6\u60c5\u201d\uff0c \u4e0d\u8d85\u8fc74\u4e2a\u6587\u5b57\uff0c\u8d85\u8fc7\u81ea\u52a8\u622a\u65ad\u3002<br \/>  &nbsp; &nbsp; },<br \/>  &nbsp; &nbsp; &quot;safe&quot;:0, \/\/\u975e\u5fc5\u987b, \u8868\u793a\u662f\u5426\u662f\u4fdd\u5bc6\u6d88\u606f\uff0c0\u8868\u793a\u53ef\u5bf9\u5916\u5206\u4eab\uff0c1\u8868\u793a\u4e0d\u80fd\u5206\u4eab\u4e14\u5185\u5bb9\u663e\u793a\u6c34\u5370\uff0c\u9ed8\u8ba4\u4e3a0<br \/>  &nbsp; &nbsp; &quot;enable_id_trans&quot;: 0,\/\/\u975e\u5fc5\u987b,\u8868\u793a\u662f\u5426\u5f00\u542fid\u8f6c\u8bd1\uff0c0\u8868\u793a\u5426\uff0c1\u8868\u793a\u662f\uff0c\u9ed8\u8ba40\u3002\u4ec5\u7b2c\u4e09\u65b9\u5e94\u7528\u9700\u8981\u7528\u5230\uff0c\u4f01\u4e1a\u81ea\u5efa\u5e94\u7528\u53ef\u4ee5\u5ffd\u7565\u3002<br \/>  &nbsp; &nbsp; &quot;enable_duplicate_check&quot;: 0,\/\/\u975e\u5fc5\u987b,\u8868\u793a\u662f\u5426\u5f00\u542f\u91cd\u590d\u6d88\u606f\u68c0\u67e5\uff0c0\u8868\u793a\u5426\uff0c1\u8868\u793a\u662f\uff0c\u9ed8\u8ba40<br \/>  &nbsp; &nbsp; &quot;duplicate_check_interval&quot;: 1800 \/\/\u975e\u5fc5\u987b,\u8868\u793a\u662f\u5426\u91cd\u590d\u6d88\u606f\u68c0\u67e5\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u9ed8\u8ba41800s(3\u5c0f\u65f6)\uff0c\u6700\u5927\u4e0d\u8d85\u8fc74\u5c0f\u65f6<br \/>  }<\/p>\n<p>  return fetch(&quot;https:\/\/qyapi.weixin.qq.com\/cgi-bin\/message\/send?access_token=&quot;+OPT.access_token,{<br \/>  &nbsp; &nbsp; method:&#8217;post&#8217;,<br \/>  &nbsp; &nbsp; body: JSON.stringify(body)<br \/>  });<br \/>  }  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>dforel<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e0d\u9519\uff0c\u611f\u8c22\u5206\u4eab\u3002\u53ef\u80fd\u67d0\u4e00\u5929\u53ef\u4ee5\u7528\u4e0a\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Nothing1024<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u611f\u8c22\u8001\u54e5\u5206\u4eab\uff01\u4e00\u4f1a\u8bd5\u8bd5https:\/\/cdn.jsdelivr.net\/gh\/hishis\/forum-master\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>jqbaobao<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u7b2c\u4e00\u6b65\u5462\u8981\u5148\u6ce8\u518c\u4f01\u4e1a\u5fae\u4fe1\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>silence<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u611f\u8c22\u5927\u4f6c\uff0c\u8fd9\u4e1c\u897f\u62ff\u6765\u63d2\u5728\u7b7e\u5230\u7a0b\u5e8f\u91cc\u5f88\u597d\u7528\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>kenshuren<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u611f\u8c22\u5206\u4eab\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>logo<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tmark zsbd\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>ktaog6<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u51fa\u95e8\u6253\u91ce\uff0c\u8def\u8fc7\u63d2\u773c\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>zhongziso<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tmark\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>b66667777<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u611f\u8c22\u5206\u4eab\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>arron \u5927\u4f6c\u6709\u8bdd\u8bf4 : CF\u7248&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/339293"}],"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=339293"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/339293\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339293"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}