{"id":1946,"date":"2018-08-16T02:45:55","date_gmt":"2018-08-15T18:45:55","guid":{"rendered":"https:\/\/blog.brain1981.com\/?p=1946"},"modified":"2022-05-19T19:45:45","modified_gmt":"2022-05-19T11:45:45","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e6%94%af%e4%bb%98%e5%8a%9f%e8%83%bd%e5%bc%80%e5%8f%91%e4%b8%8e%e8%b8%a9%e5%9d%91%e7%bb%8f%e9%aa%8c%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/blog.brain1981.com\/1946.html","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3"},"content":{"rendered":"<p><strong>2021\u5e743\u670811\u65e5\u66f4\u65b0\uff1a<\/strong><br \/>\n\u672c\u6587\u867d\u53d7\u5230\u4e00\u5b9a\u5173\u6ce8\uff0c\u4f46\u65f6\u96943\u5e74\u591a\uff0c\u5176\u4e2d\u4ee3\u7801\u4ee5\u53ca\u5b89\u5168\u6027\u90fd\u5df2\u8fc7\u65f6\uff0c\u4e3a\u907f\u514d\u5404\u4f4d\u8e29\u5751\uff0c\u8bf7\u79fb\u6b65\u6211\u7684\u53e6\u5916\u4e00\u7bc7\u6587\u7ae0\uff1a<a href=\"https:\/\/blog.brain1981.com\/2354.html\" rel=\"noopener\" target=\"_blank\">https:\/\/blog.brain1981.com\/2354.html<\/a><br \/>\n\u672c\u6587\u8bc4\u8bba\u533a\u5927\u5bb6\u6240\u63d0\u51fa\u7684\u5176\u4ed6\u95ee\u9898\uff0c\u4e5f\u90fd\u5df2\u5728\u8fd9\u7bc7\u535a\u5ba2\u5217\u51fa\u7684\u4ee3\u7801\u4e2d\u89e3\u51b3\uff0c\u5982\u679c\u4f60\u4e0d\u662f\u7528WordPress\u4e5f\u6ca1\u5173\u7cfb\uff0c\u5176\u4e2dPHP\u90e8\u5206\u7a0d\u52a0\u4fee\u6539\u5373\u53ef\u4f7f\u7528\u3002<\/p>\n<hr>\n<p>\u4ee5\u4e0b\u662f\u539f\u6587\uff1a<\/p>\n<p>\u65e9\u6709\u8033\u95fb\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u662f\u4e00\u6b65\u4e00\u5751\uff0c\u8fd9\u4e24\u5929\u679c\u7136\u8e29\u4e86\u4e2a\u904d\u3002\u9664\u4e86\u7b80\u8981\u5230\u4ee4\u4eba\u6124\u6012\u7684\u5b98\u65b9\u6587\u6863\u5916\uff0c\u7f51\u4e0a\u6240\u6709\u80fd\u641c\u5230\u7684\u76f8\u5173\u6587\u7ae0\uff0c\u4e5f\u6ca1\u6709\u4efb\u4f55\u4e00\u7bc7\u63d0\u4f9b\u7684\u4ee3\u7801\u662f\u80fd\u591f\u987a\u5229\u8dd1\u901a\u7684\u3002\u597d\u5728\u8fd8\u6709\u4e00\u90e8\u5206\u524d\u4eba\u7684\u7ecf\u9a8c\u53ef\u4ee5\u5438\u53d6\uff0c\u518d\u52a0\u4e0a\u4e2a\u4eba\u7684\u4e00\u70b9\u76f4\u89c9\u5f15\u5bfc\uff0c\u7ec8\u4e8e\u5728\u51cc\u6668\u7684\u65f6\u5019\u771f\u673a\u6d4b\u8bd5\u901a\u8fc7\u3002<\/p>\n<p>\u8d81\u70ed\u6253\u94c1\u628a\u8e29\u8fc7\u7684\u5751\u7f57\u5217\u4e00\u904d\uff0c\u6700\u540e\u4f1a\u9644\u4e0a\u771f\u673a\u8dd1\u901a\u7684\u4ee3\u7801\u3002<\/p>\n<p><strong>\u9996\u5148\u662f\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u7684\u7533\u8bf7\u3002<\/strong>\u5728\u534a\u5e74\u524d\u6211\u6709\u53e6\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u9879\u76ee\uff0c\u867d\u7136\u5f53\u65f6\u6ca1\u6709\u5f00\u901a\u5c0f\u7a0b\u5e8f\u5fae\u4fe1\u652f\u4ed8\u7684\u9700\u6c42\uff0c\u4f46\u662f\u6211\u7559\u610f\u8fc7\u5e94\u7528\u53f7\uff08\u5c0f\u7a0b\u5e8f\u53f7\uff09\u540e\u53f0\u5fae\u4fe1\u652f\u4ed8\u7684\u76f8\u5173\u9009\u9879\u3002\u5f53\u65f6\uff0c\u8fd9\u4e2a\u5c0f\u7a0b\u5e8f\u56e0\u4e3a\u7ed1\u5b9a\u8fc7\u5df2\u8ba4\u8bc1\u7684\u670d\u52a1\u53f7\uff0c\u56e0\u6b64\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u662f\u53ef\u4ee5\u76f4\u63a5\u7533\u8bf7\u7684\uff0c\u65e0\u9700\u4efb\u4f55\u8d39\u7528\u3002\u4f46\u662f\u8fd9\u6b21\u7684\u9879\u76ee\uff0c\u540c\u6837\u662f\u53e6\u4e00\u4e2a\u5df2\u7ecf\u7ed1\u5b9a\u8fc7\u8ba4\u8bc1\u670d\u52a1\u53f7\u7684\u5c0f\u7a0b\u5e8f\uff0c\u5728\u5fae\u4fe1\u652f\u4ed8\u754c\u9762\uff0c\u63d0\u793a\u6211\u8981\u8ba4\u8bc1\u5f53\u524d\u7684\u5c0f\u7a0b\u5e8f\u53f7\u624d\u80fd\u5f00\u901a\u5fae\u4fe1\u652f\u4ed8\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u7ed1\u5b9a\u670d\u52a1\u53f7\u8fd8\u4e0d\u591f\uff0c\u5fc5\u987b\u628a\u8fd9\u4e2a\u5c0f\u7a0b\u5e8f\u53f7\u4e5f\u4ea4300\u5143\u8ba4\u8bc1\u540e\uff0c\u624d\u7ed9\u5f00\u901a\u652f\u4ed8\u529f\u80fd\uff01\u771f\u7684\u5f88\u5751\uff0c\u597d\u5728\u5ba2\u6237\u6ca1\u6709\u4ec0\u4e48\u6028\u8a00\uff0c\u975e\u5e38\u914d\u5408\u5730\u5c31\u628a\u8ba4\u8bc1\u7ed9\u529e\u4e86&#8230;<\/p>\n<p>\u4e00\u5929\u540e\u5c0f\u7a0b\u5e8f\u53f7\u8ba4\u8bc1\u901a\u8fc7\uff0c\u5c31\u6709\u4e86\u7533\u8bf7\u652f\u4ed8\u7684\u5165\u53e3\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1.jpg\" alt=\"\" width=\"1008\" height=\"628\" class=\"alignnone size-full wp-image-1947\" srcset=\"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1.jpg 1008w, https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1-300x187.jpg 300w, https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1-768x478.jpg 768w, https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1-624x389.jpg 624w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><br \/>\n\u679c\u65ad\u9009\u53f3\u8fb9\u90a3\u4e2a\uff0c\u6839\u636e\u7ed9\u51fa\u7684\u63d0\u793a\uff0c\u5230\u5546\u6237\u5e73\u53f0\u91cc\u9762\u7528\u5c0f\u7a0b\u5e8f\u7684appid\u7ed1\u5b9a\u5c31\u884c\u4e86\u3002<!--more--><\/p>\n<p><strong>\u7b2c\u4e8c\u4e2a\u5751\uff0c\u83b7\u53d6openid\u3002<\/strong>\u5728\u7f51\u4e0a\u80fd\u627e\u5230\u7684\u5927\u90e8\u5206\u5b9e\u4f8b\u4ee3\u7801\u91cc\uff0c\u90fd\u628a\u83b7\u53d6openid\u7684\u63a5\u53e3\u8c03\u7528\u76f4\u63a5\u5199\u5728\u4e86\u5c0f\u7a0b\u5e8f\u4ee3\u7801\u91cc\u3002\u8fd9\u4e2a\u63a5\u53e3\u7684\u5730\u5740\u662f\u8fd9\u6837\u7684\uff1a<br \/>\n<code>https:\/\/api.weixin.qq.com\/sns\/jscode2session?appid=********&secret=********&js_code=********&grant_type=authorization_code<\/code><br \/>\n\u5176\u4e2djs_code\u662f\u901a\u8fc7wx.login\u83b7\u5f97\u7684\uff0c\u8fd9\u4e2a\u6ca1\u95ee\u9898\uff1bappid\u4e5f\u6ca1\u95ee\u9898\uff1b\u95ee\u9898\u5728secret\u4e0a\uff0c\u5373appsecret\uff0c\u8fd9\u4e2a\u5bc6\u94a5\u5982\u679c\u76f4\u63a5\u5199\u5728\u5c0f\u7a0b\u5e8f\u7aef\uff0c\u672c\u6765\u5c31\u4e0d\u592a\u5b89\u5168\u3002\u679c\u4e0d\u5176\u7136\uff0c\u5f00\u53d1\u5de5\u5177\u62a5\u9519\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-2.jpg\" alt=\"\" width=\"743\" height=\"129\" class=\"alignnone size-full wp-image-1950\" srcset=\"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-2.jpg 743w, https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-2-300x52.jpg 300w, https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-2-624x108.jpg 624w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><br \/>\n\u4e8e\u662f\u6211\u5c1d\u8bd5\u628aapi.weixin.qq.com\u57df\u540d\u52a0\u5165request\u5408\u6cd5\u57df\u540d\u5217\u8868\uff0c\u4eba\u5bb6\u4e0d\u7ed9\u6211\u52a0&#8230;<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-3.jpg\" alt=\"\" width=\"922\" height=\"403\" class=\"alignnone size-full wp-image-1951\" srcset=\"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-3.jpg 922w, https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-3-300x131.jpg 300w, https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-3-768x336.jpg 768w, https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-3-624x273.jpg 624w\" sizes=\"auto, (max-width: 922px) 100vw, 922px\" \/><\/p>\n<p>\u90a3\u5c31\u5f88\u5947\u602a\u4e86\uff0c\u4e3a\u5565\u7f51\u4e0a\u5f88\u591a\u4f8b\u5b50\u7ed9\u51fa\u7684\u4ee3\u7801\u662f\u76f4\u63a5\u8bf7\u6c42api.weixin.qq.com\u63a5\u53e3\u7684\uff1f\u522b\u4eba\u53ef\u4ee5\u6211\u5c31\u4e0d\u53ef\u4ee5\uff0c\u6ca1\u9053\u7406\u554a\uff01<\/p>\n<p>\u82b1\u4e86\u5f88\u591a\u65f6\u95f4\u67e5\u8bc1\uff0c\u5c0f\u7a0b\u5e8f\u662f\u4eca\u5e74\u5e74\u521d\u7684\u65f6\u5019\u7981\u6b62\u4e86api.weixin.qq.com\u57df\u540d\u7684\u76f4\u63a5\u8bf7\u6c42\u7684\uff0c\u76ee\u7684\u5c31\u662f\u4e3a\u4e86\u907f\u514d\u5f00\u53d1\u8005\u628aappsecret\u76f4\u63a5\u5199\u5728\u5c0f\u7a0b\u5e8f\u7aef\u7684\u4ee3\u7801\u91cc\uff0c\u9020\u6210\u5b89\u5168\u9690\u60a3\u3002\u867d\u8bf4\u662f\u4e3a\u4e86\u5b89\u5168\u7740\u60f3\uff0c\u4f46\u8fd9\u771f\u7684\u5f88\u5751\u7239\uff0c\u5b98\u65b9\u5728\u5f00\u53d1\u8d44\u6599\u91cc\u9762\u5e76\u6ca1\u6709\u63d0\u5230\u8fd9\u4e8b\u60c5\uff0c\u5bfc\u81f4\u5f88\u591a\u4eba\u5728\u6b64\u7ed5\u4e86\u5f2f\u8def\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u6211\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u5176\u5b9e\u662f\u4e00\u8def\u7ed5\u8fc7\u8fd9\u4e2a\u5751\u7684\u3002\u56e0\u4e3a\u53d1\u73b0\u867d\u7136\u5f00\u53d1\u5de5\u5177\u4f1a\u62a5\u9519\u4e0d\u80fd\u8bf7\u6c42\u8fd9\u4e2a\u57df\u540d\uff0c\u4f46\u662f\u5728\u5f00\u53d1\u5de5\u5177\u63d0\u4f9b\u7684\u8fdc\u7a0b\u8c03\u8bd5\u529f\u80fd\u91cc\uff0c\u5728\u624b\u673a\u4e0a\u662f\u53ef\u4ee5\u76f4\u63a5\u8bf7\u6c42\u8fd9\u4e2a\u63a5\u53e3\u7684\u3002\u4e8e\u662f\u83b7\u53d6openid\u8fd9\u4e2a\u8fc7\u7a0b\u5728\u6700\u521d\u7684\u5f00\u53d1\u8c03\u8bd5\u4e2d\u5e76\u6ca1\u6709\u66b4\u9732\u95ee\u9898\uff0c\u800c\u662f\u5728\u6211\u89c9\u5f97\u5df2\u7ecf\u5927\u529f\u544a\u6210\uff0c\u5373\u5c06\u63d0\u4f9b\u5bf9\u5916\u6d4b\u8bd5\u7684\u7248\u672c\u4e2d\uff0c\u5728\u624b\u673a\u4e0a\u5173\u95ed\u4e86vconsole\u540e\uff0c\u5fae\u4fe1\u652f\u4ed8\u529f\u80fd\u62c9\u4e0d\u8d77\u6765\uff0c\u5e76\u4e14\u56e0\u4e3a\u5173\u95ed\u4e86vconsole\u5c31\u770b\u4e0d\u5230\u4efb\u4f55\u62a5\u9519\u4fe1\u606f\uff0c\u662f\u76f4\u89c9\u544a\u8bc9\u6211\u8fd9\u4e2a\u8bf7\u6c42\u57df\u540d\u53d1\u751f\u4e86\u95ee\u9898\u3002\u5fae\u4fe1\u5f00\u53d1\u5c31\u662f\u8fd9\u4e48\u64cd\u86cb\uff0c\u5f88\u591a\u65f6\u5019\u5f97\u9760\u7a0b\u5e8f\u5458\u7684\u76f4\u89c9\uff0c\u800c\u4e0d\u662f\u6587\u6863&#8230;<\/p>\n<p>\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u552f\u4e00\u529e\u6cd5\u5c31\u662f\u5199\u4e00\u4e2aPHP\u6254\u5230\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u501f\u52a9\u8fd9\u4e2aPHP\u8bf7\u6c42openid\u7684\u63a5\u53e3\uff0c\u518d\u8fd4\u56de\u7ed9\u5c0f\u7a0b\u5e8f\u7aef\u3002\u8fd9\u4e2aPHP\u7684\u4ee3\u7801\u9644\u5728\u6587\u672b\u3002<\/p>\n<p><strong>\u63a5\u4e0b\u6765\u7b2c\u4e09\u4e2a\u5751\uff0c\u662f\u7b7e\u540d\u9a8c\u8bc1\u3002<\/strong>\u9996\u5148\u6211\u4eec\u8981\u8fdb\u884c\u5546\u6237\u8fd9\u91cc\u7684\u7edf\u4e00\u652f\u4ed8\u7b7e\u540d\uff0c\u628aappid\u3001\u5546\u54c1\u540d\u3001\u5546\u6237id\u3001nonce\u503c\u3001notify_url\u3001openid\u3001\u8ba2\u5355\u53f7\u3001\u91d1\u989d&#8230;.\u7b49\u7b49\u4e00\u8fde\u4e32\u7684\u503c\uff0c\u6309\u7167key=value&#038;key=value&#038;&#8230;\u683c\u5f0f\uff0ckey\u4e3a\u5b57\u6bcd\u987a\u5e8f\u6392\u5217\u4e0b\u6765\uff0c\u6700\u540e\u52a0\u4e0a&#8221;\u5546\u6237key&#8221;\uff08\u5728\u5546\u6237\u540e\u53f0\u7684\u201c\u8d26\u6237\u4e2d\u5fc3 &#8211; API\u5b89\u5168\u201d\u9875\u9762\u83b7\u5f97\uff0c\u4e5f\u53ebAPI\u5bc6\u94a5\uff09\uff0c\u7ec4\u6210\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5e76\u7ecf\u8fc7MD5\u52a0\u5bc6\u540e\u751f\u6210\u4e00\u4e32\u7b7e\u540d\u503c\u3002<br \/>\n\u8fd9\u4e9b\u503c\uff0c\u83b7\u53d6\u7684\u5730\u65b9\u54ea\u91cc\u90fd\u6709\uff0c\u5149\u6536\u96c6\u4ed6\u4eec\u5c31\u5f97\u8d39\u4e00\u756a\u529b\u6c14\uff1b\u6536\u96c6\u5b8c\u6bd5\u540e\uff0c\u8fd8\u8981\u6309\u65e2\u5b9a\u987a\u5e8f\u6392\u5217\uff0c\u4e0d\u80fd\u98a0\u5012\uff0c\u5e76\u4e14\u5546\u6237key\u503c\u662f\u4f8b\u5916\uff0c\u5f97\u6392\u5728\u6700\u540e\u3002MD5\u52a0\u5bc6\u65b9\u6cd5\u662fgitHub\u4e0a\u627e\u7684\u73b0\u6210\u4ee3\u7801\uff0c\u7ed9\u51fa\u5730\u5740\uff1a<br \/>\n<a href=\"https:\/\/github.com\/leibing8912\/WxMD5\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/leibing8912\/WxMD5<\/a><\/p>\n<p>\u4ee5\u4e0a\u7b7e\u540d\u5b8c\u6210\u540e\uff0c\u8fd8\u8981\u628a\u8fd9\u4e9b\u503c\u53bb\u6389\u6700\u540e\u7684\u5546\u6237key\uff0c\u52a0\u4e0a\u5df2\u7ecf\u5b8c\u6210\u7684\u7b7e\u540d\uff0c\u5c01\u88c5\u6210\u4e00\u4e2aXML\u683c\u5f0f\u5b57\u7b26\u4e32\uff0c\u628a\u8fd9\u4e2a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\u8bf7\u6c42\u63a5\u53e3https:\/\/api.mch.weixin.qq.com\/pay\/unifiedorder\uff0c\u5728\u8fd4\u56de\u7684\u503c\u4e2d\u63d0\u53d6\u4e00\u4e32&#8221;prepay_id=&#8221;\u503c\uff0c\u518d\u7528\u521a\u624d\u7684\u8fde\u63a5\u952e\u503c\u7684\u65b9\u6cd5\u83b7\u5f97\u957f\u5b57\u7b26\u4e32\uff0c\u8fdb\u884c<strong>\u7b2c\u4e8c\u6b21<\/strong>MD5\u52a0\u5bc6\u7b7e\u540d\u3002<\/p>\n<p>\u771fTNND\u7ed5\u554a\uff01\u6211\u4e3a\u4e86\u8c03\u8bd5\u6210\u529f\u4e24\u6b21\u7b7e\u540d\u503c\uff0c\u4e5f\u8d39\u4e86\u4e0d\u5c11\u529b\u6c14\u3002\u597d\u5728\u5728\u522b\u4eba\u7684\u6587\u7ae0\u91cc\u770b\u5230\u6709\u5fae\u4fe1\u5b98\u65b9\u63d0\u4f9b\u7684\u8c03\u8bd5\u5de5\u5177\uff0c\u5e2e\u4e86\u4e0d\u5c11\u5fd9\uff0c\u8fd9\u662f\u8c03\u8bd5\u5de5\u5177\u94fe\u63a5\uff1a<a href=\"https:\/\/pay.weixin.qq.com\/wiki\/doc\/api\/jsapi.php?chapter=20_1\" rel=\"noopener\" target=\"_blank\">https:\/\/pay.weixin.qq.com\/wiki\/doc\/api\/jsapi.php?chapter=20_1<\/a><\/p>\n<p>\u7b49\u5230\u4ee5\u4e0a\u7edf\u7edf\u5b8c\u6210\uff0c\u8fde\u540c\u521a\u624d\u83b7\u5f97\u7684\u7b7e\u540d\u503c\uff0c\u518d\u6839\u636e\u5b98\u65b9\u6587\u6863\u91cd\u65b0\u7ec4\u7ec7\u4e00\u4e0b\u5404\u4e2a\u6240\u9700\u53c2\u6570\uff0c\u624d\u80fd\u901a\u8fc7wx.requestPayment\u8bf7\u6c42\u62c9\u8d77\u652f\u4ed8\u3002\u800c\u6211\u4eec\u53ef\u7231\u7684\u5fae\u4fe1\u5b98\u65b9\u6587\u6863\uff0c\u4ec5\u4ec5\u4ecb\u7ecd\u4e86\u8fd9\u6700\u540e\u7684\u4e00\u6b65 &#8211; wx.requestPayment\u6240\u9700\u8981\u7684\u51e0\u4e2a\u53c2\u6570\u800c\u5df2\uff0c\u7ed9\u51fa\u7684\u4f8b\u7a0b\u66f4\u662f\u8ba9\u4eba\u6c57\u989c\uff0c\u6b22\u8fce\u5927\u5bb6\u53bb\u56f4\u89c2\uff08\u73b0\u5728\u662f2018\u5e748\u670816\u65e5\uff0c\u6211\u4e0d\u4f1a\u77e5\u9053\u5b98\u65b9\u5728\u6b64\u4e4b\u540e\u591a\u4e45\u4f1a\u5b8c\u5584\u5b83\u7684\u6587\u6863\uff0c\u4f46\u73b0\u5728\u8fd9\u4e2a\u6587\u6863\u770b\u6765\u662f\u5f88\u4e0d\u53cb\u597d\u7684\uff09\uff1a<a href=\"https:\/\/developers.weixin.qq.com\/miniprogram\/dev\/api\/api-pay.html#wxrequestpaymentobject\" rel=\"noopener\" target=\"_blank\">https:\/\/developers.weixin.qq.com\/miniprogram\/dev\/api\/api-pay.html#wxrequestpaymentobject<\/a><\/p>\n<p>\u4e0b\u9762\u6211\u5c06\u81ea\u5df1\u8c03\u8bd5\u5b8c\u6bd5\u7684\u4ee3\u7801\u6574\u7406\u4e00\u4e0b\uff0c\u7559\u4e2a\u5b58\u6863\uff1a<br \/>\n\u5c0f\u7a0b\u5e8f\u7aef\uff0c\u4fdd\u7559\u5927\u90e8\u5206\u7684console\u7684\u7248\u672c<\/p>\n<pre lang=\"Javascript\" line=\"0\">\r\n  \/* Author: Brain - blog.brain1981.com *\/\r\n  \/* \u5fae\u4fe1\u652f\u4ed8 *\/\r\n  goWxPay: function () {\r\n    var that = this;\r\n    \/\/\u767b\u9646\u83b7\u53d6code\r\n    wx.login({\r\n      success: function (res) {\r\n        console.log(\"\u83b7\u53d6login code\",res.code);\r\n        \/\/\u83b7\u53d6openid\r\n        that.getOpenId(res.code);\r\n      }\r\n    });\r\n  },\r\n\r\n  \/* \u83b7\u53d6openId *\/\r\n  getOpenId: function (code) {\r\n    var that = this;\r\n    wx.request({\r\n      url: \"https:\/\/****?code=\" + code, \/\/\u670d\u52a1\u5668\u7aef\u7684\u8bf7\u6c42\u5730\u5740\uff0c\u57df\u540d\u5df2\u52a0\u5165\u5c0f\u7a0b\u5e8frequest\u767d\u540d\u5355\r\n      method: 'GET',\r\n      success: function (res) {\r\n        console.log(\"\u83b7\u53d6openid\", res);\r\n        that.unitedPayRequest(res.data.openid);\r\n      },\r\n      fail: function () {\r\n        console.log(\"\u83b7\u53d6openid \u5931\u8d25\", res);\r\n      },\r\n      complete: function () {\r\n        console.log(\"\u83b7\u53d6openid \u5b8c\u6bd5\", res);\r\n      }\r\n    });\r\n  },\/\/getOpenId()\r\n  \r\n  \/*\u7edf\u4e00\u652f\u4ed8\u63a5\u53e3*\/\r\n  unitedPayRequest: function(openid){\r\n    var that=this;\r\n    \/\/\u7edf\u4e00\u652f\u4ed8\u7b7e\u540d\r\n    var appid = '';\/\/appid\u5fc5\u586b\r\n    var body = '';\/\/\u5546\u54c1\u540d\u5fc5\u586b\r\n    var mch_id = '';\/\/\u5546\u6237\u53f7\u5fc5\u586b\r\n    var nonce_str = util.randomString();\/\/\u968f\u673a\u5b57\u7b26\u4e32\uff0c\u4e0d\u957f\u4e8e32\u4f4d\u3002  \r\n    var notify_url = '';\/\/\u901a\u77e5\u5730\u5740\u5fc5\u586b\r\n    var total_fee = parseInt(0.01 * 100); \/\/\u4ef7\u683c\uff0c\u8fd9\u662f\u4e00\u5206\u94b1\r\n    var trade_type = \"JSAPI\";\r\n    var key = ''; \/\/\u5546\u6237key\u5fc5\u586b\uff0c\u5728\u5546\u6237\u540e\u53f0\u83b7\u5f97\r\n    var out_trade_no = '';\/\/\u81ea\u5b9a\u4e49\u8ba2\u5355\u53f7\u5fc5\u586b\r\n   \r\n    var unifiedPayment = 'appid=' + appid + '&body=' + body + '&mch_id=' + mch_id + '&nonce_str=' + nonce_str + '&notify_url=' + notify_url + '&openid=' + openid + '&out_trade_no=' + out_trade_no + '&total_fee=' + total_fee + '&trade_type=' + trade_type + '&key=' + key;\r\n    console.log(\"unifiedPayment\", unifiedPayment);\r\n    var sign = md5.md5(unifiedPayment).toUpperCase();\r\n    console.log(\"\u7b7e\u540dmd5\", sign);\r\n\r\n    \/\/\u5c01\u88c5\u7edf\u4e00\u652f\u4ed8xml\u53c2\u6570\r\n    var formData = \"<xml>\";\r\n    formData += \"<appid>\" + appid + \"<\/appid>\";\r\n    formData += \"<body>\" + body + \"<\/body>\";\r\n    formData += \"<mch_id>\" + mch_id + \"<\/mch_id>\";\r\n    formData += \"<nonce_str>\" + nonce_str + \"<\/nonce_str>\";\r\n    formData += \"<notify_url>\" + notify_url + \"<\/notify_url>\";\r\n    formData += \"<openid>\" + openid + \"<\/openid>\";\r\n    formData += \"<out_trade_no>\" + that.data.ordernum + \"<\/out_trade_no>\";\r\n    formData += \"<total_fee>\" + total_fee + \"<\/total_fee>\";\r\n    formData += \"<trade_type>\" + trade_type + \"<\/trade_type>\";\r\n    formData += \"<sign>\" + sign + \"<\/sign>\";\r\n    formData += \"<\/xml>\";\r\n    console.log(\"formData\", formData);\r\n    \/\/\u7edf\u4e00\u652f\u4ed8\r\n    wx.request({\r\n      url: 'https:\/\/api.mch.weixin.qq.com\/pay\/unifiedorder', \/\/\u522b\u5fd8\u4e86\u628aapi.mch.weixin.qq.com\u57df\u540d\u52a0\u5165\u5c0f\u7a0b\u5e8frequest\u767d\u540d\u5355\uff0c\u8fd9\u4e2a\u76ee\u524d\u53ef\u4ee5\u52a0\r\n      method: 'POST',\r\n      head: 'application\/x-www-form-urlencoded',\r\n      data: formData, \/\/\u8bbe\u7f6e\u8bf7\u6c42\u7684 header\r\n      success: function (res) {\r\n        console.log(\"\u8fd4\u56de\u5546\u6237\", res.data);\r\n        var result_code = util.getXMLNodeValue('result_code', res.data.toString(\"utf-8\"));\r\n        var resultCode = result_code.split('[')[2].split(']')[0];\r\n        if (resultCode == 'FAIL') {\r\n          var err_code_des = util.getXMLNodeValue('err_code_des', res.data.toString(\"utf-8\"));\r\n          var errDes = err_code_des.split('[')[2].split(']')[0];\r\n          wx.showToast({\r\n            title: errDes,\r\n            icon: 'none',\r\n            duration: 3000\r\n          })\r\n        } else {\r\n          \/\/\u53d1\u8d77\u652f\u4ed8\r\n          var prepay_id = util.getXMLNodeValue('prepay_id', res.data.toString(\"utf-8\"));\r\n          var tmp = prepay_id.split('[');\r\n          var tmp1 = tmp[2].split(']');\r\n          \/\/\u7b7e\u540d  \r\n          var key = '';\/\/\u5546\u6237key\u5fc5\u586b\uff0c\u5728\u5546\u6237\u540e\u53f0\u83b7\u5f97\r\n          var appId = '';\/\/appid\u5fc5\u586b\r\n          var timeStamp = util.createTimeStamp();\r\n          var nonceStr = util.randomString();\r\n          var stringSignTemp = \"appId=\" + appId + \"&nonceStr=\" + nonceStr + \"&package=prepay_id=\" + tmp1[0] + \"&signType=MD5&timeStamp=\" + timeStamp + \"&key=\" + key;\r\n          console.log(\"\u7b7e\u540d\u5b57\u7b26\u4e32\", stringSignTemp);\r\n          var sign = md5.md5(stringSignTemp).toUpperCase();\r\n          console.log(\"\u7b7e\u540d\", sign);\r\n          var param = { \"timeStamp\": timeStamp, \"package\": 'prepay_id=' + tmp1[0], \"paySign\": sign, \"signType\": \"MD5\", \"nonceStr\": nonceStr }\r\n          console.log(\"param\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u63a5\u53e3\u53c2\u6570\", param);\r\n          that.processPay(param);\r\n        }\r\n\r\n      },\r\n    })\r\n\r\n  },\/\/unitedPayRequest()\r\n\r\n  \/* \u5c0f\u7a0b\u5e8f\u652f\u4ed8 *\/\r\n  processPay: function (param) {\r\n    wx.requestPayment({\r\n      timeStamp: param.timeStamp,\r\n      nonceStr: param.nonceStr,\r\n      package: param.package,\r\n      signType: param.signType,\r\n      paySign: param.paySign,\r\n      success: function (res) {\r\n        \/\/ success\r\n        console.log(\"wx.requestPayment\u8fd4\u56de\u4fe1\u606f\",res);\r\n        wx.showModal({\r\n          title: '\u652f\u4ed8\u6210\u529f',\r\n          content: '\u60a8\u5c06\u5728\u201c\u5fae\u4fe1\u652f\u4ed8\u201d\u5b98\u65b9\u53f7\u4e2d\u6536\u5230\u652f\u4ed8\u51ed\u8bc1',\r\n          showCancel: false,\r\n          success: function (res) {\r\n            if (res.confirm) {\r\n            } else if (res.cancel) {\r\n            }\r\n          }\r\n        })\r\n      },\r\n      fail: function () {\r\n        console.log(\"\u652f\u4ed8\u5931\u8d25\");\r\n      },\r\n      complete: function () {\r\n        console.log(\"\u652f\u4ed8\u5b8c\u6210(\u6210\u529f\u6216\u5931\u8d25\u90fd\u4e3a\u5b8c\u6210)\");\r\n      }\r\n    })\r\n  }\/\/processPay()\r\n<\/pre>\n<p>\u51e0\u4e2a\u8981\u7528\u5230\u7684\u65b9\u6cd5\uff0c\u9664\u4e86MD5\u7528\u4eceGithub\u4e0a\u627e\u7684\u4ee3\u7801\uff0c\u5176\u4ed6\u5982\u4e0b\uff1a<\/p>\n<pre lang=\"Javascript\" line=\"0\">\r\n\/* Author: Brain - blog.brain1981.com *\/\r\n\/* \u65f6\u95f4\u6233\u4ea7\u751f\u51fd\u6570   *\/\r\nfunction createTimeStamp() {\r\n  return parseInt(new Date().getTime() \/ 1000) + ''\r\n}\r\n\/* \u968f\u673a\u6570 *\/\r\nfunction randomString() {\r\n  var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; \/\/\u9ed8\u8ba4\u53bb\u6389\u4e86\u5bb9\u6613\u6df7\u6dc6\u7684\u5b57\u7b26oOLl,9gq,Vv,Uu,I1\r\n  var maxPos = chars.length;\r\n  var pwd = '';\r\n  for (var i = 0; i < 32; i++) {\r\n    pwd += chars.charAt(Math.floor(Math.random() * maxPos));\r\n  }\r\n  return pwd;\r\n}\r\n\/* \u83b7\u53d6XML\u8282\u70b9\u4fe1\u606f *\/\r\nfunction getXMLNodeValue(node_name, xml) {\r\n  var tmp = xml.split(\"<\" + node_name + \">\")\r\n  var _tmp = tmp[1].split(\"<\/\" + node_name + \">\")\r\n  return _tmp[0]\r\n}\r\nmodule.exports = {\r\n  createTimeStamp: createTimeStamp,\r\n  randomString: randomString,\r\n  getXMLNodeValue: getXMLNodeValue\r\n}\r\n<\/pre>\n<p>\u5728\u670d\u52a1\u7aef\u83b7\u53d6openid\u7684PHP\u4ee3\u7801<\/p>\n<pre lang=\"Javascript\" line=\"0\">\r\n\/\/\u83b7\u53d6\u7528\u6237openid\r\nfunction getPortData($url){\r\n\t$ch = curl_init();\r\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\tcurl_setopt($ch, CURLOPT_POST, 0);\r\n\tcurl_setopt($ch, CURLOPT_HEADER, false);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\t$r = curl_exec($ch);\r\n\t\/\/$r = json_decode($r);\r\n\tif($error=curl_error($ch)){\r\n\t\tdie($error);\r\n\t}\r\n\tcurl_close($ch);\r\n\treturn $r;\r\n}\r\n\r\nfunction getopenid(){\r\n\t$code = $_GET[\"code\"];\r\n\tif(empty($code)) return array('status'=>0,'info'=>'\u7f3a\u5c11js_code');\r\n\t$appid = '';\/\/\u5fc5\u586b\r\n\t$appsecret = '';\/\/\u5fc5\u586b\r\n\t$url = \"https:\/\/api.weixin.qq.com\/sns\/jscode2session?appid=\".$appid.\"&secret=\".$appsecret.\"&js_code=\".$code.\"&grant_type=authorization_code\";\r\n\t$result = getPortData($url);\r\n\t\/\/var_dump($result);\r\n\techo $result;\r\n}\r\ngetopenid();\r\n<\/pre>\n<p>\u81ea\u6b64\uff0c\u62fc\u62fc\u51d1\u51d1\u5730\u603b\u7b97\u628a\u5c0f\u7a0b\u5e8f\u5fae\u4fe1\u652f\u4ed8\u8dd1\u8d77\u6765\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2021\u5e743\u670811\u65e5\u66f4\u65b0\uff1a \u672c\u6587\u867d\u53d7\u5230\u4e00\u5b9a\u5173\u6ce8\uff0c\u4f46\u65f6\u96943\u5e74\u591a\uff0c\u5176\u4e2d\u4ee3\u7801\u4ee5\u53ca\u5b89\u5168\u6027\u90fd\u5df2\u8fc7\u65f6\uff0c\u4e3a\u907f\u514d\u5404\u4f4d\u8e29\u5751\uff0c\u8bf7\u79fb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[83],"class_list":["post-1946","post","type-post","status-publish","format-standard","hentry","category-front-end-development","tag-83"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3 - Brain\u7684\u6280\u672f\u7b14\u8bb0<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.brain1981.com\/1946.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3 - Brain\u7684\u6280\u672f\u7b14\u8bb0\" \/>\n<meta property=\"og:description\" content=\"2021\u5e743\u670811\u65e5\u66f4\u65b0\uff1a \u672c\u6587\u867d\u53d7\u5230\u4e00\u5b9a\u5173\u6ce8\uff0c\u4f46\u65f6\u96943\u5e74\u591a\uff0c\u5176\u4e2d\u4ee3\u7801\u4ee5\u53ca\u5b89\u5168\u6027\u90fd\u5df2\u8fc7\u65f6\uff0c\u4e3a\u907f\u514d\u5404\u4f4d\u8e29\u5751\uff0c\u8bf7\u79fb [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.brain1981.com\/1946.html\" \/>\n<meta property=\"og:site_name\" content=\"Brain\u7684\u6280\u672f\u7b14\u8bb0\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-15T18:45:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-19T11:45:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1.jpg\" \/>\n<meta name=\"author\" content=\"Brain\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brain\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html\"},\"author\":{\"name\":\"Brain\",\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/#\\\/schema\\\/person\\\/7689202bbb2f967b4c66309c1cc5e65d\"},\"headline\":\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3\",\"datePublished\":\"2018-08-15T18:45:55+00:00\",\"dateModified\":\"2022-05-19T11:45:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html\"},\"wordCount\":108,\"commentCount\":30,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/#\\\/schema\\\/person\\\/7689202bbb2f967b4c66309c1cc5e65d\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.brain1981.com\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/wxapp-1.jpg\",\"keywords\":[\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\"],\"articleSection\":[\"\u524d\u7aef\u5f00\u53d1\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.brain1981.com\\\/1946.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html\",\"url\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html\",\"name\":\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3 - Brain\u7684\u6280\u672f\u7b14\u8bb0\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.brain1981.com\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/wxapp-1.jpg\",\"datePublished\":\"2018-08-15T18:45:55+00:00\",\"dateModified\":\"2022-05-19T11:45:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.brain1981.com\\\/1946.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html#primaryimage\",\"url\":\"https:\\\/\\\/blog.brain1981.com\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/wxapp-1.jpg\",\"contentUrl\":\"https:\\\/\\\/blog.brain1981.com\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/wxapp-1.jpg\",\"width\":1008,\"height\":628},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/1946.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/blog.brain1981.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/#website\",\"url\":\"https:\\\/\\\/blog.brain1981.com\\\/\",\"name\":\"Brain\u7684\u6280\u672f\u7b14\u8bb0\",\"description\":\"WordPress\u5efa\u7ad9\u5f00\u53d1\u6559\u7a0b\u4e0e\u6280\u672f\u7814\u7a76\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/#\\\/schema\\\/person\\\/7689202bbb2f967b4c66309c1cc5e65d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.brain1981.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/#\\\/schema\\\/person\\\/7689202bbb2f967b4c66309c1cc5e65d\",\"name\":\"Brain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/favicon.webp\",\"url\":\"https:\\\/\\\/blog.brain1981.com\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/favicon.webp\",\"contentUrl\":\"https:\\\/\\\/blog.brain1981.com\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/favicon.webp\",\"width\":75,\"height\":75,\"caption\":\"Brain\"},\"logo\":{\"@id\":\"https:\\\/\\\/blog.brain1981.com\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/favicon.webp\"},\"sameAs\":[\"http:\\\/\\\/brain1981.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3 - Brain\u7684\u6280\u672f\u7b14\u8bb0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.brain1981.com\/1946.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3 - Brain\u7684\u6280\u672f\u7b14\u8bb0","og_description":"2021\u5e743\u670811\u65e5\u66f4\u65b0\uff1a \u672c\u6587\u867d\u53d7\u5230\u4e00\u5b9a\u5173\u6ce8\uff0c\u4f46\u65f6\u96943\u5e74\u591a\uff0c\u5176\u4e2d\u4ee3\u7801\u4ee5\u53ca\u5b89\u5168\u6027\u90fd\u5df2\u8fc7\u65f6\uff0c\u4e3a\u907f\u514d\u5404\u4f4d\u8e29\u5751\uff0c\u8bf7\u79fb [&hellip;]","og_url":"https:\/\/blog.brain1981.com\/1946.html","og_site_name":"Brain\u7684\u6280\u672f\u7b14\u8bb0","article_published_time":"2018-08-15T18:45:55+00:00","article_modified_time":"2022-05-19T11:45:45+00:00","og_image":[{"url":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1.jpg","type":"","width":"","height":""}],"author":"Brain","twitter_misc":{"\u4f5c\u8005":"Brain","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.brain1981.com\/1946.html#article","isPartOf":{"@id":"https:\/\/blog.brain1981.com\/1946.html"},"author":{"name":"Brain","@id":"https:\/\/blog.brain1981.com\/#\/schema\/person\/7689202bbb2f967b4c66309c1cc5e65d"},"headline":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3","datePublished":"2018-08-15T18:45:55+00:00","dateModified":"2022-05-19T11:45:45+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.brain1981.com\/1946.html"},"wordCount":108,"commentCount":30,"publisher":{"@id":"https:\/\/blog.brain1981.com\/#\/schema\/person\/7689202bbb2f967b4c66309c1cc5e65d"},"image":{"@id":"https:\/\/blog.brain1981.com\/1946.html#primaryimage"},"thumbnailUrl":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1.jpg","keywords":["\u5fae\u4fe1\u5c0f\u7a0b\u5e8f"],"articleSection":["\u524d\u7aef\u5f00\u53d1"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.brain1981.com\/1946.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.brain1981.com\/1946.html","url":"https:\/\/blog.brain1981.com\/1946.html","name":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3 - Brain\u7684\u6280\u672f\u7b14\u8bb0","isPartOf":{"@id":"https:\/\/blog.brain1981.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.brain1981.com\/1946.html#primaryimage"},"image":{"@id":"https:\/\/blog.brain1981.com\/1946.html#primaryimage"},"thumbnailUrl":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1.jpg","datePublished":"2018-08-15T18:45:55+00:00","dateModified":"2022-05-19T11:45:45+00:00","breadcrumb":{"@id":"https:\/\/blog.brain1981.com\/1946.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.brain1981.com\/1946.html"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/blog.brain1981.com\/1946.html#primaryimage","url":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1.jpg","contentUrl":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2018\/08\/wxapp-1.jpg","width":1008,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/blog.brain1981.com\/1946.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/blog.brain1981.com\/"},{"@type":"ListItem","position":2,"name":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u529f\u80fd\u5f00\u53d1\u4e0e\u8e29\u5751\u7ecf\u9a8c\u603b\u7ed3"}]},{"@type":"WebSite","@id":"https:\/\/blog.brain1981.com\/#website","url":"https:\/\/blog.brain1981.com\/","name":"Brain\u7684\u6280\u672f\u7b14\u8bb0","description":"WordPress\u5efa\u7ad9\u5f00\u53d1\u6559\u7a0b\u4e0e\u6280\u672f\u7814\u7a76","publisher":{"@id":"https:\/\/blog.brain1981.com\/#\/schema\/person\/7689202bbb2f967b4c66309c1cc5e65d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.brain1981.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.brain1981.com\/#\/schema\/person\/7689202bbb2f967b4c66309c1cc5e65d","name":"Brain","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2026\/01\/favicon.webp","url":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2026\/01\/favicon.webp","contentUrl":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2026\/01\/favicon.webp","width":75,"height":75,"caption":"Brain"},"logo":{"@id":"https:\/\/blog.brain1981.com\/wp-content\/uploads\/2026\/01\/favicon.webp"},"sameAs":["http:\/\/brain1981.com"]}]}},"views":62497,"_links":{"self":[{"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/posts\/1946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/comments?post=1946"}],"version-history":[{"count":18,"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/posts\/1946\/revisions"}],"predecessor-version":[{"id":2878,"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/posts\/1946\/revisions\/2878"}],"wp:attachment":[{"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/media?parent=1946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/categories?post=1946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.brain1981.com\/wp-json\/wp\/v2\/tags?post=1946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}