{"id":1974,"date":"2026-09-22T15:16:35","date_gmt":"2026-09-22T07:16:35","guid":{"rendered":"https:\/\/www.jumoon.top\/?p=1974"},"modified":"2026-09-22T19:42:58","modified_gmt":"2026-09-22T11:42:58","slug":"cloudflaer-workers%e5%be%ae%e4%bf%a1%e5%85%ac%e4%bc%97%e5%8f%b7%e6%b5%8b%e8%af%95%e6%8e%a5%e5%8f%a3%e9%83%a8%e7%bd%b2%e7%a7%81%e6%9c%89%e6%b6%88%e6%81%af%e6%8e%a8%e9%80%81","status":"publish","type":"post","link":"https:\/\/www.jumoon.top\/?p=1974","title":{"rendered":"Cloudflaer Workers+\u5fae\u4fe1\u516c\u4f17\u53f7\u6d4b\u8bd5\u63a5\u53e3\u90e8\u7f72\u79c1\u6709\u6d88\u606f\u63a8\u9001"},"content":{"rendered":"\n<p>\u672c\u9879\u76ee\u662f\u57fa\u4e8e\u4ee5\u4e0b\u4e24\u4e2a\u9879\u76ee\u505a\u7684\u4f18\u5316\uff0c\u539f\u9879\u76ee\u62c6\u5c01\u6210\u4e86\u4e24\u90e8\u5206\uff0c\u6d88\u606f\u63a8\u9001\u548c\u6d88\u606f\u6d4f\u89c8\u9700\u8981\u5206\u522b\u90e8\u7f72\uff0c\u6211\u5acc\u9ebb\u70e6\uff0c\u5c06\u5176\u4f18\u5316\u540e\u5408\u5e76\u5230\u4e86\u4e00\u8d77\uff0c\u4ee3\u7801\u4e5f\u505a\u4e86\u4f18\u5316\uff0c\u7f29\u51cf\u5230\u4e86573\u884c\uff0c\u8fd9\u6837\u53ea\u9700\u8981\u4e00\u6b21\u90e8\u7f72\uff0c\u7ed1\u5b9a\u4e00\u4e2a\u57df\u540d\uff0c\u4e0d\u7528\u591a\u6b21\u90e8\u7f72\u7ed1\u5b9a\u3002\u5404\u6709\u5229\u5f0a\u5427\uff0c\u5206\u5f00\u6709\u5206\u5f00\u7684\u597d\u3002<\/p>\n\n\n\n<p><strong>\u9879\u76ee\u6765\u6e90\uff1a<br><\/strong>https:\/\/github.com\/frankiejun\/wxpush<br>https:\/\/github.com\/frankiejun\/wxpushSkin<\/p>\n\n\n\n<p><strong>\u4e00\u3001\u7533\u8bf7\u5fae\u4fe1\u6d4b\u8bd5\u53f7<br><\/strong>\u6253\u5f00\uff1ahttps:\/\/mp.weixin.qq.com\/debug\/cgi-bin\/sandbox?t=sandbox\/login<br>\u7528\u4f60\u7684\u5fae\u4fe1\u626b\u7801\u767b\u5f55<br>\u5411\u4e0b\u6eda\u52a8\uff0c\u627e\u5230\u4ee5\u4e0b\u4fe1\u606f\u5e76\u8bb0\u4e0b\u6765\uff1a<br>appID<br>appsecret<br>\u7528\u9700\u8981\u63a5\u6536\u6d88\u606f\u7684\u5fae\u4fe1\u626b\u300c\u6d4b\u8bd5\u53f7\u4e8c\u7ef4\u7801\u300d\u5173\u6ce8\uff0c\u5237\u65b0\u9875\u9762\uff0c\u5728\u300c\u6d4b\u8bd5\u53f7\u7528\u6237\u5217\u8868\u300d\u4e2d\u4f1a\u770b\u5230\u4f60\u7684 \u5fae\u4fe1\u53f7\uff0c\u4e00\u4f1a\u513f\u8981\u7528\u3002<br>\u6a21\u677f\u6d88\u606f\u63a5\u53e3\uff0c\u65b0\u589e\u6d4b\u8bd5\u6a21\u677f\uff0c\u6807\u9898\u586b\u5165\uff1a\u6d88\u606f\u63a8\u9001, \u5185\u5bb9\u586b\u5165\uff1a\u5185\u5bb9\uff1a{{content.DATA}} \uff0c\u8fd9\u91cc\u7684\u6a21\u677fID(\u7528\u4e8e\u63a5\u53e3\u8c03\u7528)\uff0c\u4e00\u4f1a\u513f\u8981\u7528\u3002<\/p>\n\n\n\n<p><strong>\u4e8c\u3001\u90e8\u7f72\u4e3b\u63a8\u9001\u670d\u52a1\uff08Cloudflare Workers\uff09<br><\/strong>\u767b\u5f55 Cloudflare \u2192 Workers &amp; Pages \uff0c\u4ece Hello World \u5f00\u59cb\u90e8\u7f72\uff0c\u53d6\u4e2a\u540d\u5b57\uff08\u5982 wx\uff09\u2192 Create worker<br>\u70b9\u51fb Edit code \u2192 \u628a\u9ed8\u8ba4\u4ee3\u7801\u5168\u5220\uff0c\u7c98\u8d34\u9879\u76ee\u6e90\u7801<br>\u4fdd\u5b58 \u2192 Deploy<br>\u7136\u540e\u70b9 Settings \u2192 Variables\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u73af\u5883\u53d8\u91cf<br>\u5168\u90e8\u586b\u597d\u540e\u70b9\u6700\u4e0b\u65b9\u7684 Deploy\uff0c\u4e3b\u670d\u52a1\u5c31\u90e8\u7f72\u5b8c\u6210\uff01<\/p>\n\n\n\n<p>\u8bbf\u95ee\u683c\u5f0f\uff1a<br>https:\/\/\u4f60\u7684worker\u57df\u540d.workers.dev\/\u4f60\u7684API_TOKEN<br>\u4f8b\u5982\uff1a<br>https:\/\/wx.xxx.workers.dev\/k9xP2mZqkjkdsahfjdsfs2FDeJ4hF6gD9cA0sB2vG3<br>\u6253\u5f00\u5c31\u662f\u81ea\u5e26\u6d4b\u8bd5\u9875\uff0c\u586b\u5185\u5bb9\u70b9\u53d1\u9001\u5c31\u80fd\u6536\u5230\u5fae\u4fe1\u6d88\u606f\u5566\uff01<\/p>\n\n\n\n<p><strong>\u4e09\u3001\u5b9e\u9645\u4f7f\u7528\u793a\u4f8b<br><\/strong>\u652f\u6301 Webhook \u7684\u9879\u76ee\uff08\u54ea\u5412\u3001UptimeKuma\u3001\u9752\u9f99\u9762\u677f\u3001HealthChecks \u7b49\uff09\u90fd\u80fd\u8f7b\u677e\u63a5\u5165\uff1a<\/p>\n\n\n\n<p>\u8bf7\u6c42\u65b9\u5f0f\uff1a POST \u6216 GET \u5747\u53ef<br>URL\uff1a https:\/\/\u4f60\u7684worker\u57df\u540d.workers.dev\/wxsend<br>\u8bf7\u6c42\u5934: {&#8220;Authorization&#8221;: &#8220;\u4f60\u7684token&#8221;, &#8220;Content-Type&#8221;: &#8220;application\/json&#8221;}<br>body: { &#8220;content&#8221;: &#8220;\u4f60\u7684\u5185\u5bb9&#8221;, &#8220;title&#8221;:&#8221;\u4f60\u7684\u6807\u9898&#8221; }<\/p>\n\n\n\n<p>\u57fa\u7840\u63a8\u9001\uff1a<br>https:\/\/wx.yourdomain.com\/wxsend?title=\u670d\u52a1\u5668\u901a\u77e5&amp;content=\u670d\u52a1\u5df2\u4e8e\u5317\u4eac\u65f6\u95f42026-09-22 14:00\u91cd\u542f&amp;token=k9xP2mZqkjkdsahfjdsfs2FDeJ4hF6gD9cA0sB2vG3<\/p>\n\n\n\n<p>Linux \u4e0b\u76f4\u63a5\u6d4b\u8bd5\u7684\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -X POST \\\n  \"https:\/\/&lt;\u60a8\u7684Worker\u5730\u5740&gt;\/wxsend\" \\\n  -H \"Authorization: \u4f60\u7684token\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"title\": \"\u6d4b\u8bd5\u6d88\u606f\",\n    \"content\": \"\u81ea\u52a8\u5316\u4efb\u52a1\u5df2\u5b8c\u6210\u3002\"\n  }'<\/code><\/pre>\n\n\n\n<p>\u4e3a\u4e86\u597d\u8bb0\uff0c\u5f3a\u70c8\u5efa\u8bae\u7ed1\u5b9a\u81ea\u5b9a\u4e49\u57df\u540d\uff0c\u4f8b\u5982\uff1ahttps:\/\/wx.yourdomain.com<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter\"><table class=\"has-fixed-layout\"><thead><tr><th>\u53d8\u91cf\u540d<\/th><th>\u793a\u4f8b\u503c<\/th><th>\u8bf4\u660e<\/th><\/tr><\/thead><tbody><tr><td><code>API_TOKEN<\/code><\/td><td><code>k9xP2mZqkjkdsahfjdsfs2FDeJ4hF6gD9cA0sB2vG3<\/code><\/td><td>\u8c03\u7528\u63a5\u53e3\u7684\u8bbf\u95ee\u4ee4\u724c\uff0c\u52a1\u5fc5\u8bbe\u7f6e\u590d\u6742\u968f\u673a\u5b57\u7b26\u4e32\uff0c\u7531\u4f60\u81ea\u5df1\u81ea\u5b9a\u4e49<\/td><\/tr><tr><td><code>WX_APPID<\/code><\/td><td><code>wx1234567890abcdef<\/code><\/td><td>\u6d4b\u8bd5\u53f7\u9996\u9875\u7684 AppID<\/td><\/tr><tr><td><code>WX_SECRET<\/code><\/td><td><code>0123456789abcdef0123456789abcdef0123456789ab<\/code><\/td><td>\u6d4b\u8bd5\u53f7\u9996\u9875\u7684 AppSecret<\/td><\/tr><tr><td><code>WX_USERID<\/code><\/td><td><code>o_abcd1234efgh5678|o_ijkl9012mnop3456<\/code><\/td><td>\u63a5\u6536\u8005 \u5fae\u4fe1\u53f7\uff0c\u591a\u4e2a\u7528\u6237\u7528\u7ad6\u7ebf <code>|<\/code> \u5206\u9694<\/td><\/tr><tr><td><code>WX_TEMPLATE_ID<\/code><\/td><td><code>AbC123dEFGhIJKlmnOPQRStuvwxYZ<\/code><\/td><td>\u7b2c\u4e00\u6b65\u6dfb\u52a0\u6a21\u677f\u540e\u5f97\u5230\u7684 template_id<\/td><\/tr><tr><td><code>WX_BASE_URL<\/code><\/td><td>https:\/\/wx.yourdomain.com<\/td><td>\u5fae\u4fe1\u4e2d\u70b9\u51fb\u6d88\u606f\u540e\u8df3\u8f6c\u7684\u8be6\u60c5\u9875\u5730\u5740\uff0c\u586b\u5199\u4f60Workers\u7684\u9ed8\u8ba4\u57df\u540d\u6216\u8005\u4f60\u6307\u5b9a\u7684\u57df\u540d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"1024\" src=\"https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/ed97b07775748960b074de2d165b1ae3-461x1024.jpg\" alt=\"\" class=\"wp-image-1984\" srcset=\"https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/ed97b07775748960b074de2d165b1ae3-461x1024.jpg 461w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/ed97b07775748960b074de2d165b1ae3-135x300.jpg 135w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/ed97b07775748960b074de2d165b1ae3-768x1707.jpg 768w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/ed97b07775748960b074de2d165b1ae3-691x1536.jpg 691w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/ed97b07775748960b074de2d165b1ae3-921x2048.jpg 921w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/ed97b07775748960b074de2d165b1ae3-scaled.jpg 1152w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"526\" src=\"https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-30-59-1024x526.png\" alt=\"\" class=\"wp-image-1975\" srcset=\"https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-30-59-1024x526.png 1024w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-30-59-300x154.png 300w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-30-59-768x394.png 768w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-30-59.png 1093w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"466\" src=\"https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-49-54-1024x466.png\" alt=\"\" class=\"wp-image-1976\" srcset=\"https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-49-54-1024x466.png 1024w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-49-54-300x137.png 300w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-49-54-768x350.png 768w, https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/2026-09-22_14-49-54.png 1184w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u662fWorker\u7528\u5230\u7684\u90e8\u7f72\u4ee3\u7801\uff1a<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-7397b8cd-5f76-4844-897a-d201cf9740be\" href=\"https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/worker.rar\">worker<\/a><a href=\"https:\/\/www.jumoon.top\/wp-content\/uploads\/2026\/09\/worker.rar\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-7397b8cd-5f76-4844-897a-d201cf9740be\">\u4e0b\u8f7d<\/a><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u9879\u76ee\u662f\u57fa\u4e8e\u4ee5\u4e0b\u4e24\u4e2a\u9879\u76ee\u505a\u7684\u4f18\u5316\uff0c\u539f\u9879\u76ee\u62c6\u5c01\u6210\u4e86\u4e24\u90e8\u5206\uff0c\u6d88\u606f\u63a8\u9001\u548c\u6d88\u606f\u6d4f\u89c8\u9700\u8981\u5206\u522b\u90e8\u7f72\uff0c\u6211\u5acc\u9ebb\u70e6\uff0c\u5c06\u5176\u4f18\u5316\u540e\u5408 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[19],"tags":[],"class_list":["post-1974","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/posts\/1974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1974"}],"version-history":[{"count":8,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/posts\/1974\/revisions"}],"predecessor-version":[{"id":1990,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/posts\/1974\/revisions\/1990"}],"wp:attachment":[{"href":"https:\/\/www.jumoon.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}