{"id":42218,"date":"2025-06-07T07:25:46","date_gmt":"2025-06-06T23:25:46","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/42218.html"},"modified":"2025-06-07T07:25:46","modified_gmt":"2025-06-06T23:25:46","slug":"%e4%bd%a0%e4%bb%a5%e4%b8%ba%e4%ba%91%e5%bc%80%e5%8f%91%e5%8f%aa%e6%98%af%e4%b8%8d%e7%94%a8%e9%85%8d%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%9f%e6%94%af%e4%bb%98%e5%ae%9d%e5%b0%8f%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/42218.html","title":{"rendered":"\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01"},"content":{"rendered":"<p>&#x1f3c6;\u672c\u6587\u6536\u5f55\u4e8e\u300a\u6eda\u96ea\u7403\u5b66\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u300b\u4e13\u680f&#xff0c;\u5e0c\u671b\u80fd\u591f\u52a9\u4f60\u4e00\u81c2\u4e4b\u529b&#xff0c;\u5e2e\u4f60\u65e9\u65e5\u767b\u9876\u5b9e\u73b0\u8d22\u5bcc\u81ea\u7531&#x1f680;&#xff1b;\u540c\u65f6&#xff0c;\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8&amp;&amp;\u6536\u85cf&amp;&amp;\u8ba2\u9605&#xff01;\u6301\u7eed\u66f4\u65b0\u4e2d&#xff0c;up&#xff01;up&#xff01;up&#xff01;&#xff01;<\/p>\n<\/p>\n<h4>\u5168\u6587\u76ee\u5f55&#xff1a;<\/h4>\n<ul>\n<li>\n<ul>\n<li>&#x1f680; \u524d\u8a00&#xff1a;\u4ec0\u4e48\u90fd\u653e\u524d\u7aef&#xff0c;\u8fdf\u65e9\u4f1a\u540e\u6094&#xff1b;\u4ec0\u4e48\u90fd\u5199\u540e\u7aef&#xff0c;\u5199\u6b7b\u4f60&#xff01;<\/li>\n<li>\u2601\ufe0f \u4e91\u51fd\u6570&#xff1a;\u4e0d\u7528\u670d\u52a1\u5668&#xff0c;\u4e5f\u80fd\u5f53\u540e\u7aef&#xff0c;\u652f\u4ed8\u5b9d\u8ba9\u4f60\u201c\u53ea\u5199\u903b\u8f91\u5c31\u597d\u201d<\/li>\n<li>&#x1f5c4;\ufe0f \u4e91\u6570\u636e\u5e93 &#043; \u4e91\u5b58\u50a8&#xff1a;\u522b\u518d\u5199\u5047\u6570\u636e\u4e86&#xff0c;\u8fd9\u624d\u662f\u201c\u6b63\u7ecf\u4e91\u5f00\u53d1\u201d<\/li>\n<li>\n<ul>\n<li>&#x1f31f; \u6570\u636e\u5e93\u4f7f\u7528&#xff08;\u57fa\u4e8e\u4e91\u51fd\u6570\u4e2d\u64cd\u4f5c&#xff09;<\/li>\n<li>&#x1f5c2;\ufe0f \u4e91\u5b58\u50a8\u4f7f\u7528&#xff08;\u4e0a\u4f20\u7528\u6237\u56fe\u7247 \/ \u6587\u4ef6&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>&#x1f510; \u4e91\u8c03\u7528\u7684\u5b89\u5168\u673a\u5236\u548c\u6743\u9650\u7ba1\u7406&#xff1a;\u522b\u8ba9\u201c\u8c03 API\u201d\u53d8\u6210\u201c\u88f8\u5954\u7684\u707e\u96be\u73b0\u573a\u201d<\/li>\n<li>\n<ul>\n<li>\u2705 \u4e91\u51fd\u6570\u5929\u7136\u5177\u5907\u201c\u6c99\u7bb1\u9694\u79bb\u201d<\/li>\n<li>\u2705 \u8bf7\u6c42\u6765\u6e90\u9a8c\u8bc1<\/li>\n<li>\u2705 \u63a5\u53e3\u9632\u5237 &#043; \u9650\u9891\u5904\u7406<\/li>\n<\/ul>\n<\/li>\n<li>&#x1f4bc; \u5b9e\u9645\u9879\u76ee\u6848\u4f8b\u5c55\u793a&#xff1a;\u6211\u4eec\u5982\u4f55\u7528\u652f\u4ed8\u5b9d\u4e91\u5f00\u53d1&#xff0c;\u505a\u51fa\u4e00\u4e2a\u201c\u65e0\u670d\u52a1\u5668\u201d\u7684\u5c0f\u5546\u57ce<\/li>\n<li>\n<ul>\n<li>&#x1f4a1; \u9879\u76ee\u67b6\u6784\u8bbe\u8ba1<\/li>\n<\/ul>\n<\/li>\n<li>\u2764\ufe0f \u603b\u7ed3&#xff1a;\u4e91\u5f00\u53d1\u4e0d\u662f\u672a\u6765&#xff0c;\u5b83\u662f\u6b63\u5728\u53d1\u751f\u7684\u73b0\u5b9e<\/li>\n<li>&#x1f9e7;&#x1f9e7; \u798f\u5229\u8d60\u4e0e\u4f60 &#x1f9e7;&#x1f9e7;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p> <img decoding=\"async\" width=\"180\" height=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250606232545-684378f948b95.png\" \/> <\/p>\n<h3>&#x1f680; \u524d\u8a00&#xff1a;\u4ec0\u4e48\u90fd\u653e\u524d\u7aef&#xff0c;\u8fdf\u65e9\u4f1a\u540e\u6094&#xff1b;\u4ec0\u4e48\u90fd\u5199\u540e\u7aef&#xff0c;\u5199\u6b7b\u4f60&#xff01;<\/h3>\n<p>\u76f8\u4fe1\u6211&#xff0c;\u4f5c\u4e3a\u4e00\u4e2a\u5168\u6808\u82e6\u5de5\u6211\u89c1\u8fc7\u592a\u591a\u201c\u53cd\u4eba\u7c7b\u67b6\u6784\u201d\u3002\u6709\u4e9b\u9879\u76ee\u628a\u6240\u6709\u903b\u8f91\u653e\u524d\u7aef&#xff0c;\u4e00\u5806 token &#043; header &#043; openId \u5728\u5ba2\u6237\u7aef\u66b4\u9732\u5f97\u660e\u660e\u767d\u767d&#xff0c;\u4e00\u770b\u5c31\u662f\u201c\u88ab\u653b\u51fb\u5199\u6b7b\u7684\u6700\u4f73\u8303\u4f8b\u201d\u3002\u6709\u4e9b\u5219\u975e\u8981\u914d\u540e\u7aef\u3001\u90e8\u7f72 Nginx\u3001\u7ef4\u62a4\u6570\u636e\u5e93\u3001\u641e SSL \u8bc1\u4e66\u3001\u79df\u963f\u91cc\u4e91\u2026\u2026\u4f60\u505a\u4e2a\u5fae\u578b\u7535\u5546&#xff0c;\u914d\u5f97\u50cf\u4e2a SaaS \u5e73\u53f0&#xff0c;\u6298\u78e8\u81ea\u5df1\u8fd8\u5413\u9000\u56e2\u961f\u3002<\/p>\n<p>\u6709\u6ca1\u6709\u529e\u6cd5\u6298\u4e2d&#xff1f;\u5f53\u7136\u6709\u3002<\/p>\n<p>\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u73b0\u5728\u5176\u5b9e\u65e9\u5c31\u8fdb\u5165\u4e86 Serverless \u4e91\u5f00\u53d1\u65f6\u4ee3&#xff0c;\u5b83\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u6574\u5957\u8f7b\u91cf\u7ea7\u7684\u4e91\u51fd\u6570 &#043; \u6570\u636e\u5e93 &#043; \u6587\u4ef6\u5b58\u50a8\u80fd\u529b\u2014\u2014\u4f60\u4e0d\u7528\u81ea\u5df1\u642d\u5efa\u540e\u7aef&#xff0c;\u4f46\u4f9d\u7136\u80fd\u62e5\u6709\u201c\u5b8c\u6574\u7684\u540e\u7aef\u80fd\u529b\u201d&#xff0c;\u542c\u8d77\u6765\u662f\u4e0d\u662f\u5f88\u9999&#xff1f;\u800c\u4e14\u5728\u5b9e\u9645\u4f01\u4e1a\u7ea7\u9879\u76ee\u4e2d&#xff0c;\u5b83\u662f\u771f\u7684\u80fd\u5e72\u6d3b\u7684&#xff0c;\u4e0d\u662f\u73a9\u5177&#xff01;<\/p>\n<p>\u6240\u4ee5&#xff0c;\u8fd9\u4e00\u7bc7\u6211\u4eec\u5c31\u6765\u6df1\u6316&#xff1a;\u652f\u4ed8\u5b9d\u4e91\u5f00\u53d1\u7684\u5e95\u5c42\u903b\u8f91\u3001\u4f7f\u7528\u59ff\u52bf\u3001\u5b9e\u6218\u6848\u4f8b\u3001\u6743\u9650\u673a\u5236\u3001\u5751\u70b9\u907f\u96f7&#xff01;<\/p>\n<p>\u6211\u6562\u4fdd\u8bc1&#xff0c;\u8bfb\u5b8c\u8fd9\u7bc7&#xff0c;\u4f60\u4f1a\u60f3\u628a\u4f60\u90a3\u4e9b\u62fc\u62fc\u51d1\u51d1\u7684\u201c\u4f2a\u540e\u7aef\u201d\u7edf\u7edf\u6254\u8fdb\u5783\u573e\u6876\u3002<\/p>\n<h3>\u2601\ufe0f \u4e91\u51fd\u6570&#xff1a;\u4e0d\u7528\u670d\u52a1\u5668&#xff0c;\u4e5f\u80fd\u5f53\u540e\u7aef&#xff0c;\u652f\u4ed8\u5b9d\u8ba9\u4f60\u201c\u53ea\u5199\u903b\u8f91\u5c31\u597d\u201d<\/h3>\n<p>\u652f\u4ed8\u5b9d\u7684\u4e91\u51fd\u6570\u662f Serverless \u67b6\u6784\u4e2d\u7684\u201c\u57fa\u7840\u8bbe\u65bd\u7ea7\u80fd\u529b\u201d&#xff0c;\u5b98\u65b9\u539f\u8bdd\u662f&#xff1a;\u5f00\u53d1\u8005\u65e0\u9700\u642d\u5efa\u670d\u52a1\u5668&#xff0c;\u53ea\u9700\u7f16\u5199\u51fd\u6570\u903b\u8f91&#xff0c;\u5e73\u53f0\u5e2e\u4f60\u6258\u7ba1\u8fd0\u884c\u3002<\/p>\n<p>\u4f60\u53ea\u9700\u8981\u5728\u652f\u4ed8\u5b9d\u5f00\u53d1\u8005\u5e73\u53f0\u521b\u5efa\u4e91\u51fd\u6570\u670d\u52a1&#xff0c;\u5c31\u80fd\u5728\u5c0f\u7a0b\u5e8f\u4e2d\u901a\u8fc7 my.cloud.callFunction \u8fdc\u7a0b\u8c03\u7528\u5b83&#xff0c;\u5e76\u83b7\u5f97\u8fd4\u56de\u7ed3\u679c\u3002<\/p>\n<p>\u6765\u770b\u6700\u6838\u5fc3\u7684\u4ee3\u7801\u7ed3\u6784&#x1f447;<\/p>\n<p><span class=\"token comment\">\/\/ \u5c0f\u7a0b\u5e8f\u7aef\u8c03\u7528&#xff08;\u524d\u7aef&#xff09;<\/span><br \/>\nmy<span class=\"token punctuation\">.<\/span>cloud<span class=\"token punctuation\">.<\/span><span class=\"token function\">callFunction<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token literal-property property\">name<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;getUserProfile&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token literal-property property\">data<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token literal-property property\">userId<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;abc123&#039;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token function-variable function\">success<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">res<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;\u2705 \u4e91\u51fd\u6570\u8fd4\u56de&#xff1a;&#039;<\/span><span class=\"token punctuation\">,<\/span> res<span class=\"token punctuation\">.<\/span>result<span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token function-variable function\">fail<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">err<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;\u274c \u4e91\u51fd\u6570\u8c03\u7528\u5931\u8d25&#039;<\/span><span class=\"token punctuation\">,<\/span> err<span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u7136\u540e\u6211\u4eec\u6765\u770b\u4e91\u51fd\u6570\u903b\u8f91&#xff08;\u5728\u4e91\u5f00\u53d1\u63a7\u5236\u53f0\u4e2d\u7f16\u5199&#xff09;&#x1f447;<\/p>\n<p>exports<span class=\"token punctuation\">.<\/span><span class=\"token function-variable function\">main<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">async<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">event<span class=\"token punctuation\">,<\/span> context<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> userId <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> event<br \/>\n  <span class=\"token keyword\">const<\/span> userInfo <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">await<\/span> <span class=\"token function\">getUserFromDB<\/span><span class=\"token punctuation\">(<\/span>userId<span class=\"token punctuation\">)<\/span> <span class=\"token comment\">\/\/ \u5047\u8bbe\u5c01\u88c5\u597d\u7684\u6570\u636e\u5e93\u67e5\u8be2\u51fd\u6570<\/span><br \/>\n  <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token literal-property property\">success<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">data<\/span><span class=\"token operator\">:<\/span> userInfo<br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u91cc\u6700\u91cd\u8981\u7684\u4e00\u70b9\u662f&#xff1a;\u4f60\u53ef\u4ee5\u5728\u4e91\u51fd\u6570\u4e2d\u5b89\u5168\u5730\u8bbf\u95ee\u6570\u636e\u5e93\u3001\u7b2c\u4e09\u65b9\u63a5\u53e3\u3001\u8fdb\u884c\u6743\u9650\u6821\u9a8c\u3001\u5199\u65e5\u5fd7\u3001\u8c03\u7528\u670d\u52a1\u7aef SDK&#xff0c;\u8fd9\u4e9b\u524d\u7aef\u662f\u505a\u4e0d\u5230\u7684\u3002<\/p>\n<p>\u4f60\u4e0d\u9700\u8981 Nginx&#xff0c;\u4e0d\u9700\u8981\u90e8\u7f72 API \u670d\u52a1&#xff0c;\u76f4\u63a5\u901a\u8fc7 my.cloud.callFunction() \u2192 \u4e91\u7aef\u6267\u884c\u903b\u8f91 \u2192 \u8fd4\u56de\u6570\u636e&#xff0c;\u4e00\u5957\u6d41\u7a0b\u5e72\u51c0\u5229\u843d\u3002<\/p>\n<h3>&#x1f5c4;\ufe0f \u4e91\u6570\u636e\u5e93 &#043; \u4e91\u5b58\u50a8&#xff1a;\u522b\u518d\u5199\u5047\u6570\u636e\u4e86&#xff0c;\u8fd9\u624d\u662f\u201c\u6b63\u7ecf\u4e91\u5f00\u53d1\u201d<\/h3>\n<p>\u652f\u4ed8\u5b9d\u4e91\u5f00\u53d1\u652f\u6301 MongoDB \u7c7b\u578b\u7684\u6587\u6863\u6570\u636e\u5e93&#xff0c;\u4e5f\u652f\u6301\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1&#xff08;\u963f\u91cc\u4e91 OSS \u63a5\u5165&#xff09;&#xff0c;\u8ba9\u4f60\u80fd\u5728\u4e91\u51fd\u6570\u6216\u5c0f\u7a0b\u5e8f\u4e2d\u8fdb\u884c\u6570\u636e\u7684\u8bfb\u5199\u7ba1\u7406\u3002<\/p>\n<h4>&#x1f31f; \u6570\u636e\u5e93\u4f7f\u7528&#xff08;\u57fa\u4e8e\u4e91\u51fd\u6570\u4e2d\u64cd\u4f5c&#xff09;<\/h4>\n<p>\u4f60\u53ef\u4ee5\u5728\u4e91\u51fd\u6570\u4e2d\u8fd9\u6837\u64cd\u4f5c\u6570\u636e\u5e93&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> db <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">require<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;&#064;alicloud\/cloud-db&#039;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token comment\">\/\/ \u4f9d\u8d56\u89c6\u73af\u5883\u800c\u5b9a<\/span><\/p>\n<p>exports<span class=\"token punctuation\">.<\/span><span class=\"token function-variable function\">main<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">async<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">event<span class=\"token punctuation\">,<\/span> context<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> nickname <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> event<\/p>\n<p>  <span class=\"token keyword\">const<\/span> result <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">await<\/span> db<span class=\"token punctuation\">.<\/span><span class=\"token function\">collection<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;users&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">add<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n    nickname<span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">createdAt<\/span><span class=\"token operator\">:<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">Date<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>  <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token literal-property property\">code<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">msg<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;\u5199\u5165\u6210\u529f&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">data<\/span><span class=\"token operator\">:<\/span> result<br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5f53\u7136\u4e5f\u53ef\u4ee5\u505a\u67e5\u8be2\u3001\u66f4\u65b0\u3001\u5220\u9664\u64cd\u4f5c&#xff0c;\u652f\u6301 MongoDB \u7684\u67e5\u8be2\u8bed\u6cd5&#xff0c;\u4f8b\u5982 db.collection(&#039;users&#039;).where({ city: &#039;\u676d\u5dde&#039; }).get()\u3002<\/p>\n<h4>&#x1f5c2;\ufe0f \u4e91\u5b58\u50a8\u4f7f\u7528&#xff08;\u4e0a\u4f20\u7528\u6237\u56fe\u7247 \/ \u6587\u4ef6&#xff09;<\/h4>\n<p>\u652f\u4ed8\u5b9d\u63a8\u8350\u4f7f\u7528\u963f\u91cc\u4e91 OSS \u63a5\u5165\u4e91\u5b58\u50a8&#xff0c;\u5c24\u5176\u662f\u5f53\u4f60\u9700\u8981\u4e0a\u4f20\u56fe\u7247\u3001\u5934\u50cf\u3001\u8ba2\u5355\u51ed\u8bc1\u7b49\u6587\u4ef6\u65f6&#xff0c;\u4e0d\u5efa\u8bae\u76f4\u63a5 base64 \u5b58\u5230\u6570\u636e\u5e93&#xff01;<\/p>\n<p><span class=\"token comment\">\/\/ \u524d\u7aef\u4e0a\u4f20<\/span><br \/>\nmy<span class=\"token punctuation\">.<\/span><span class=\"token function\">chooseImage<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token literal-property property\">count<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token function-variable function\">success<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">res<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> filePath <span class=\"token operator\">&#061;<\/span> res<span class=\"token punctuation\">.<\/span>apFilePaths<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>    my<span class=\"token punctuation\">.<\/span><span class=\"token function\">uploadFileToAliCloud<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n      filePath<span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token function-variable function\">success<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">uploadRes<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;\u4e0a\u4f20\u6210\u529f&#xff1a;&#039;<\/span><span class=\"token punctuation\">,<\/span> uploadRes<span class=\"token punctuation\">)<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u5b9e\u9645\u4e1a\u52a1\u4e2d&#xff0c;\u6211\u4eec\u901a\u5e38\u628a\u4e0a\u4f20 URL \u548c\u7b7e\u540d\u4fe1\u606f\u4ece\u4e91\u51fd\u6570\u4e2d\u83b7\u53d6&#xff0c;\u518d\u8fdb\u884c\u4e0a\u4f20&#xff0c;\u4fdd\u969c\u4e0a\u4f20\u5b89\u5168\u6027\u3002<\/p>\n<p>\u2705 \u6587\u4ef6\u7c7b\u6570\u636e\u653e OSS \u2705 JSON \u6570\u636e\u653e\u4e91\u6570\u636e\u5e93 \u2705 \u4e1a\u52a1\u903b\u8f91\u5168\u5199\u4e91\u51fd\u6570 \u4f60\u5c31\u62e5\u6709\u4e86\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u3001\u72ec\u7acb\u8fd0\u884c\u3001\u5b89\u5168\u53ef\u9760\u7684\u670d\u52a1\u5c42&#xff01;<\/p>\n<h3>&#x1f510; \u4e91\u8c03\u7528\u7684\u5b89\u5168\u673a\u5236\u548c\u6743\u9650\u7ba1\u7406&#xff1a;\u522b\u8ba9\u201c\u8c03 API\u201d\u53d8\u6210\u201c\u88f8\u5954\u7684\u707e\u96be\u73b0\u573a\u201d<\/h3>\n<p>\u652f\u4ed8\u5b9d\u4e91\u5f00\u53d1\u7684\u5b89\u5168\u673a\u5236\u8bbe\u8ba1\u5176\u5b9e\u662f\u975e\u5e38\u5b8c\u6574\u7684&#xff0c;\u53ea\u4e0d\u8fc7\u5f88\u591a\u5f00\u53d1\u8005\u56fe\u5feb\u4e0d\u770b\u6587\u6863&#xff0c;\u76f4\u63a5 callFunction \u5199\u6b7b\u53c2\u6570&#xff0c;\u4e0d\u505a\u9274\u6743\u9a8c\u8bc1&#xff0c;\u6700\u7ec8\u917f\u6210\u201c\u5927 bug\u201d\u3002<\/p>\n<p>\u6211\u4eec\u6765\u804a\u51e0\u4e2a\u5173\u952e\u70b9\u3002<\/p>\n<h4>\u2705 \u4e91\u51fd\u6570\u5929\u7136\u5177\u5907\u201c\u6c99\u7bb1\u9694\u79bb\u201d<\/h4>\n<p>\u4f60\u6bcf\u4e00\u4e2a\u4e91\u51fd\u6570\u90fd\u662f\u5728\u72ec\u7acb\u73af\u5883\u4e2d\u8fd0\u884c\u7684&#xff0c;\u5176\u4ed6\u5f00\u53d1\u8005\u65e0\u6cd5\u8bbf\u95ee&#xff0c;\u4e5f\u65e0\u6cd5\u7ed5\u5f00\u6388\u6743\u8c03\u7528&#xff0c;\u4e0d\u50cf\u4f20\u7edf API \u6709\u53ef\u80fd\u88ab\u4f2a\u9020\u8bf7\u6c42\u653b\u51fb\u3002<\/p>\n<h4>\u2705 \u8bf7\u6c42\u6765\u6e90\u9a8c\u8bc1<\/h4>\n<p>\u4f60\u53ef\u4ee5\u5728 context \u5bf9\u8c61\u4e2d\u8bfb\u53d6\u8c03\u7528\u6765\u6e90\u3001\u7528\u6237\u6807\u8bc6&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>exports<span class=\"token punctuation\">.<\/span><span class=\"token function-variable function\">main<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">async<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">event<span class=\"token punctuation\">,<\/span> context<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> userId<span class=\"token punctuation\">,<\/span> appId <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> context<\/p>\n<p>  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>userId<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">error<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;\u672a\u6388\u6743\u7528\u6237&#xff0c;\u7981\u6b62\u8bbf\u95ee&#039;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u505a ACL \u6821\u9a8c<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">isUserInWhitelist<\/span><span class=\"token punctuation\">(<\/span>userId<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">error<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;\u6743\u9650\u4e0d\u8db3&#039;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u4e1a\u52a1\u903b\u8f91<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6b64\u5916&#xff0c;\u4e91\u51fd\u6570\u4e2d\u4f60\u53ef\u4ee5\u5f15\u5165\u670d\u52a1\u5668\u7aef\u903b\u8f91&#xff0c;\u4f8b\u5982\u751f\u6210\u52a0\u5bc6 token\u3001\u505a\u63a5\u53e3\u7b7e\u540d\u9a8c\u771f\u3001\u8c03\u7528\u6570\u636e\u5e93\u505a\u89d2\u8272\u5224\u65ad\u7b49&#xff0c;\u8fd9\u4e9b\u90fd\u6bd4\u524d\u7aef\u6267\u884c\u66f4\u5b89\u5168\u3002<\/p>\n<h4>\u2705 \u63a5\u53e3\u9632\u5237 &#043; \u9650\u9891\u5904\u7406<\/h4>\n<p>\u5efa\u8bae\u5728\u9ad8\u9891\u8c03\u7528\u51fd\u6570\u4e2d\u52a0\u5165\u9891\u7387\u9650\u5236&#xff08;\u5982 60s \u5185\u4e0d\u5141\u8bb8\u91cd\u590d\u5199\u5165\u3001\u9650\u5236\u4e0a\u4f20\u6b21\u6570\u7b49&#xff09;&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> rateLimiter <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">require<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;your-rate-limit-sdk&#039;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>rateLimiter<span class=\"token punctuation\">.<\/span><span class=\"token function\">check<\/span><span class=\"token punctuation\">(<\/span>userId<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">code<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">429<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token literal-property property\">msg<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;\u8bf7\u6c42\u8fc7\u4e8e\u9891\u7e41&#xff0c;\u8bf7\u7a0d\u540e\u518d\u8bd5&#039;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4e00\u5207\u4e91\u51fd\u6570\u90fd\u8981\u5047\u8bbe\u201c\u8c03\u7528\u8005\u4e0d\u53ef\u4fe1\u201d&#xff0c;\u4e0d\u8981\u56e0\u4e3a\u662f\u5728\u652f\u4ed8\u5b9d\u5e73\u53f0\u5c31\u6389\u4ee5\u8f7b\u5fc3\u3002<\/p>\n<h3>&#x1f4bc; \u5b9e\u9645\u9879\u76ee\u6848\u4f8b\u5c55\u793a&#xff1a;\u6211\u4eec\u5982\u4f55\u7528\u652f\u4ed8\u5b9d\u4e91\u5f00\u53d1&#xff0c;\u505a\u51fa\u4e00\u4e2a\u201c\u65e0\u670d\u52a1\u5668\u201d\u7684\u5c0f\u5546\u57ce<\/h3>\n<p>\u6211\u4eec\u56e2\u961f\u505a\u8fc7\u4e00\u4e2a\u5185\u5d4c\u5728\u652f\u4ed8\u5b9d\u751f\u6d3b\u53f7\u7684\u5c0f\u578b\u5546\u57ce\u7cfb\u7edf&#xff0c;\u529f\u80fd\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u7528\u6237\u6d4f\u89c8\u5546\u54c1<\/li>\n<li>\u4e0b\u5355\u8d2d\u4e70<\/li>\n<li>\u4e0a\u4f20\u4ed8\u6b3e\u622a\u56fe&#xff08;\u975e\u81ea\u52a8\u5316&#xff09;<\/li>\n<li>\u4e91\u7aef\u67e5\u770b\u8ba2\u5355\u3001\u53d1\u8d27\u72b6\u6001<\/li>\n<\/ul>\n<p>\u5168\u90e8\u57fa\u4e8e\u4e91\u5f00\u53d1\u5b8c\u6210&#xff0c;\u6ca1\u6709\u540e\u7aef API&#xff0c;\u6ca1\u6709\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002<\/p>\n<h4>&#x1f4a1; \u9879\u76ee\u67b6\u6784\u8bbe\u8ba1<\/h4>\n<ul>\n<li>\u9875\u9762\u4ea4\u4e92&#xff1a;\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u539f\u751f\u6846\u67b6&#xff08;\u9875\u9762\u3001\u7ec4\u4ef6&#xff09;<\/li>\n<li>\u6570\u636e\u5b58\u50a8&#xff1a;\u5546\u54c1\u5217\u8868\u3001\u8ba2\u5355\u5217\u8868 \u5b58 MongoDB \u4e91\u6570\u636e\u5e93<\/li>\n<li>\u6587\u4ef6\u4e0a\u4f20&#xff1a;\u4ed8\u6b3e\u622a\u56fe\u5b58 OSS&#xff08;\u8c03\u7528\u4e91\u51fd\u6570\u83b7\u53d6\u7b7e\u540d&#xff09;<\/li>\n<li>\u4e1a\u52a1\u903b\u8f91&#xff1a;\u5168\u90e8\u8d70\u4e91\u51fd\u6570&#xff08;\u5546\u54c1\u67e5\u8be2\u3001\u8ba2\u5355\u521b\u5efa\u3001\u72b6\u6001\u66f4\u65b0&#xff09;<\/li>\n<\/ul>\n<p>\u524d\u7aef\u8c03\u7528&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ \u521b\u5efa\u8ba2\u5355<\/span><br \/>\nmy<span class=\"token punctuation\">.<\/span>cloud<span class=\"token punctuation\">.<\/span><span class=\"token function\">callFunction<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token literal-property property\">name<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;createOrder&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token literal-property property\">data<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token literal-property property\">productId<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;p001&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">count<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">1<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token function-variable function\">success<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">res<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    my<span class=\"token punctuation\">.<\/span><span class=\"token function\">alert<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">content<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;\u8ba2\u5355\u63d0\u4ea4\u6210\u529f&#039;<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u4e91\u51fd\u6570\u903b\u8f91&#xff1a;<\/p>\n<p>exports<span class=\"token punctuation\">.<\/span><span class=\"token function-variable function\">main<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">async<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">event<span class=\"token punctuation\">,<\/span> context<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> productId<span class=\"token punctuation\">,<\/span> count <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> event<br \/>\n  <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> userId <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> context<\/p>\n<p>  <span class=\"token keyword\">const<\/span> orderId <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">generateOrderId<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token keyword\">await<\/span> db<span class=\"token punctuation\">.<\/span><span class=\"token function\">collection<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;orders&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">add<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n    orderId<span class=\"token punctuation\">,<\/span><br \/>\n    productId<span class=\"token punctuation\">,<\/span><br \/>\n    count<span class=\"token punctuation\">,<\/span><br \/>\n    userId<span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">status<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;pending&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">createdAt<\/span><span class=\"token operator\">:<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">Date<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>  <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">success<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span> orderId <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u524d\u540e\u7aef\u4e00\u4f53\u3001\u90e8\u7f72\u6210\u672c\u4f4e\u3001\u7ef4\u62a4\u8f7b\u677e\u3001\u4e0a\u7ebf\u5feb\u901f&#xff0c;\u771f\u6b63\u4f53\u4f1a\u5230\u4e86\u201cServerless \u7684\u9999\u201d\u3002<\/p>\n<h3>\u2764\ufe0f \u603b\u7ed3&#xff1a;\u4e91\u5f00\u53d1\u4e0d\u662f\u672a\u6765&#xff0c;\u5b83\u662f\u6b63\u5728\u53d1\u751f\u7684\u73b0\u5b9e<\/h3>\n<p>\u5728\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7684\u8fd9\u51e0\u5e74\u91cc&#xff0c;\u4ece\u6700\u521d\u7684\u624b\u64b8\u540e\u7aef&#xff0c;\u5230\u73b0\u5728\u7684\u201c\u5199\u51fd\u6570\u5373\u670d\u52a1\u201d&#xff0c;\u6211\u89c1\u8bc1\u4e86 Serverless \u5728\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u98de\u901f\u6210\u719f\u3002\u4f60\u53ef\u80fd\u8fd8\u6ca1\u5b8c\u5168\u7528\u8d77\u6765&#xff0c;\u4f46\u5e73\u53f0\u5df2\u7ecf\u66ff\u4f60\u94fa\u597d\u4e86\u8def\u3002<\/p>\n<p>\u4f60\u4e0d\u7528\u518d\u79df\u670d\u52a1\u5668&#xff0c;\u4e0d\u7528\u518d\u8dd1 nginx&#xff0c;\u4e0d\u7528\u518d\u7ba1\u6570\u636e\u5e93\u8fde\u63a5\u6c60&#xff0c;\u53ea\u9700\u8981\u5173\u5fc3\u4f60\u7684\u903b\u8f91\u662f\u5426\u8db3\u591f\u7b80\u6d01\u6e05\u6670\u3002<\/p>\n<p>\u4e91\u51fd\u6570 &#043; \u4e91\u6570\u636e\u5e93 &#043; OSS \u5b58\u50a8 &#043; \u5b89\u5168\u6c99\u7bb1 &#043; \u5b9e\u65f6\u8c03\u7528 &#061; \u8db3\u4ee5\u652f\u6491\u4e2d\u5c0f\u9879\u76ee\u4e0a\u7ebf\u4e0e\u8fed\u4ee3\u7684\u5b8c\u6574\u65b9\u6848\u3002<\/p>\n<p>\u800c\u672a\u6765&#xff0c;\u968f\u7740 Serverless \u67b6\u6784\u7684\u666e\u53ca&#xff0c;\u540e\u7aef\u5373\u670d\u52a1\u7684\u601d\u7ef4\u4f1a\u6210\u4e3a\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7684\u9ed8\u8ba4\u5f62\u6001\u3002<\/p>\n<p>\u522b\u518d\u72b9\u8c6b\u4e86&#xff0c;\u4ece\u4eca\u5929\u5f00\u59cb&#xff0c;\u5c31\u5c1d\u8bd5\u7528\u652f\u4ed8\u5b9d\u4e91\u51fd\u6570\u5199\u4e00\u4e2a\u5c0f\u63a5\u53e3&#xff0c;\u4ece\u201c\u524d\u7aef\u8c03\u7528\u540e\u7aef\u903b\u8f91\u201d\u5f00\u59cb&#xff0c;\u4f60\u4f1a\u6253\u5f00\u65b0\u4e16\u754c\u7684\u5927\u95e8\u3002<\/p>\n<p> <img decoding=\"async\" width=\"180\" height=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250606232545-684378f95e8e4.png\" \/> <\/p>\n<h3>&#x1f9e7;&#x1f9e7; \u798f\u5229\u8d60\u4e0e\u4f60 &#x1f9e7;&#x1f9e7;<\/h3>\n<p>\u2003\u2003\u65e0\u8bba\u4f60\u662f\u8ba1\u7b97\u673a\u4e13\u4e1a\u7684\u5b66\u751f&#xff0c;\u8fd8\u662f\u5bf9\u7f16\u7a0b\u6709\u5174\u8da3\u7684\u5c0f\u4f19\u4f34&#xff0c;\u90fd\u5efa\u8bae\u76f4\u63a5\u6beb\u65e0\u987e\u5fcc\u7684\u5b66\u4e60\u6b64\u4e13\u680f\u300c\u6eda\u96ea\u7403\u5b66\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5168\u96c6\u300d&#xff0c;bug\u83cc\u90d1\u91cd\u627f\u8bfa&#xff0c;\u51e1\u662f\u5b66\u4e60\u6b64\u4e13\u680f\u7684\u540c\u5b66&#xff0c;\u5747\u80fd\u83b7\u53d6\u5230\u6240\u9700\u7684\u77e5\u8bc6\u548c\u6280\u80fd&#xff0c;\u5168\u7f51\u6700\u5feb\u901f\u5165\u95e8\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u7f16\u7a0b&#xff0c;\u5c31\u50cf\u6eda\u96ea\u7403\u4e00\u6837&#xff0c;\u8d8a\u6eda\u8d8a\u5927&#xff0c;\u6307\u6570\u7ea7\u63d0\u5347\u3002<\/p>\n<p>\u6700\u540e&#xff0c;\u5982\u679c\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9&#xff0c;\u5e2e\u5fd9\u7ed9\u4f5c\u8005\u6765\u4e2a\u4e00\u952e\u4e09\u8fde&#xff0c;\u5173\u6ce8\u3001\u70b9\u8d5e\u3001\u6536\u85cf&#xff0c;\u60a8\u7684\u652f\u6301\u5c31\u662f\u6211\u575a\u6301\u5199\u4f5c\u6700\u5927\u7684\u52a8\u529b\u3002<\/p>\n<p>\u540c\u65f6\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u516c\u4f17\u53f7:\u300c\u733f\u5708\u5947\u5999\u5c4b\u300d &#xff0c;\u4ee5\u4fbf\u5b66\u4e60\u66f4\u591a\u540c\u7c7b\u578b\u7684\u6280\u672f\u6587\u7ae0&#xff0c;\u514d\u8d39\u767d\u5ad6\u6700\u65b0BAT\u4e92\u8054\u7f51\u516c\u53f8\u9762\u8bd5\u9898\u30014000G pdf\u7535\u5b50\u4e66\u7c4d\u3001\u7b80\u5386\u6a21\u677f\u3001\u6280\u672f\u6587\u7ae0Markdown\u6587\u6863\u7b49\u6d77\u91cf\u8d44\u6599\u3002<\/p>\n<p>\u6211\u662fbug\u83cc&#xff0c;CSDN | \u6398\u91d1 | InfoQ | 51CTO | \u534e\u4e3a\u4e91 | \u963f\u91cc\u4e91 | \u817e\u8baf\u4e91 \u7b49\u793e\u533a\u535a\u5ba2\u4e13\u5bb6&#xff0c;C\u7ad9\u535a\u5ba2\u4e4b\u661fTop30&#xff0c;\u534e\u4e3a\u4e91\u591a\u5e74\u5ea6\u5341\u4f73\u535a\u4e3b\u53ca\u5f71\u54cd\u529b\u6700\u4f73\u535a\u4e3b&#xff0c;\u6398\u91d1\u591a\u5e74\u5ea6\u4eba\u6c14\u4f5c\u8005Top40&#xff0c;\u6398\u91d1\u7b49\u5404\u5927\u793e\u533a\u5e73\u53f0\u7b7e\u7ea6\u4f5c\u8005&#xff0c;51CTO\u5e74\u5ea6\u535a\u4e3bTop12&#xff0c;\u6398\u91d1\/InfoQ\/51CTO\u7b49\u793e\u533a\u4f18\u8d28\u521b\u4f5c\u8005&#xff1b;\u5168\u7f51\u7c89\u4e1d\u5408\u8ba1 30w&#043;&#xff1b;\u66f4\u591a\u7cbe\u5f69\u798f\u5229\u70b9\u51fb\u8fd9\u91cc&#xff1b;\u786c\u6838\u5fae\u4fe1\u516c\u4f17\u53f7\u300c\u733f\u5708\u5947\u5999\u5c4b\u300d&#xff0c;\u6b22\u8fce\u4f60\u7684\u52a0\u5165&#xff01;\u514d\u8d39\u767d\u5ad6\u6700\u65b0BAT\u4e92\u8054\u7f51\u516c\u53f8\u9762\u8bd5\u771f\u9898\u30014000G PDF\u7535\u5b50\u4e66\u7c4d\u3001\u7b80\u5386\u6a21\u677f\u7b49\u6d77\u91cf\u8d44\u6599&#xff0c;\u4f60\u60f3\u8981\u7684\u6211\u90fd\u6709&#xff0c;\u5173\u952e\u662f\u4f60\u4e0d\u6765\u62ff\u3002<\/p>\n<p> <img decoding=\"async\" width=\"780\" height=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250606232545-684378f96a1a0.png\" \/> <\/p>\n<p>-End-<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\ud83c\udfc6\u672c\u6587\u6536\u5f55\u4e8e\u300a\u6eda\u96ea\u7403\u5b66\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u300b\u4e13\u680f\uff0c\u5e0c\u671b\u80fd\u591f\u52a9\u4f60\u4e00\u81c2\u4e4b\u529b\uff0c\u5e2e\u4f60\u65e9\u65e5\u767b\u9876\u5b9e\u73b0\u8d22\u5bcc\u81ea\u7531\ud83d\ude80\uff1b\u540c\u65f6\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8&amp;&amp;\u6536\u85cf&amp;&amp;\u8ba2\u9605\uff01\u6301\u7eed\u66f4\u65b0\u4e2d\uff0cup\uff01up\uff01up\uff01\uff01<\/p>\n","protected":false},"author":2,"featured_media":42215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3923,3925,556,3924,43],"topic":[],"class_list":["post-42218","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-3923","tag-3925","tag-556","tag-3924","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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:\/\/www.wsisp.com\/helps\/42218.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\ud83c\udfc6\u672c\u6587\u6536\u5f55\u4e8e\u300a\u6eda\u96ea\u7403\u5b66\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u300b\u4e13\u680f\uff0c\u5e0c\u671b\u80fd\u591f\u52a9\u4f60\u4e00\u81c2\u4e4b\u529b\uff0c\u5e2e\u4f60\u65e9\u65e5\u767b\u9876\u5b9e\u73b0\u8d22\u5bcc\u81ea\u7531\ud83d\ude80\uff1b\u540c\u65f6\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8&amp;&amp;\u6536\u85cf&amp;&amp;\u8ba2\u9605\uff01\u6301\u7eed\u66f4\u65b0\u4e2d\uff0cup\uff01up\uff01up\uff01\uff01\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/42218.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-06T23:25:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250606232545-684378f948b95.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/42218.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/42218.html\",\"name\":\"\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-06T23:25:46+00:00\",\"dateModified\":\"2025-06-06T23:25:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/42218.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/42218.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/42218.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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:\/\/www.wsisp.com\/helps\/42218.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\ud83c\udfc6\u672c\u6587\u6536\u5f55\u4e8e\u300a\u6eda\u96ea\u7403\u5b66\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u300b\u4e13\u680f\uff0c\u5e0c\u671b\u80fd\u591f\u52a9\u4f60\u4e00\u81c2\u4e4b\u529b\uff0c\u5e2e\u4f60\u65e9\u65e5\u767b\u9876\u5b9e\u73b0\u8d22\u5bcc\u81ea\u7531\ud83d\ude80\uff1b\u540c\u65f6\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8&amp;&amp;\u6536\u85cf&amp;&amp;\u8ba2\u9605\uff01\u6301\u7eed\u66f4\u65b0\u4e2d\uff0cup\uff01up\uff01up\uff01\uff01","og_url":"https:\/\/www.wsisp.com\/helps\/42218.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-06T23:25:46+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250606232545-684378f948b95.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/42218.html","url":"https:\/\/www.wsisp.com\/helps\/42218.html","name":"\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-06T23:25:46+00:00","dateModified":"2025-06-06T23:25:46+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/42218.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/42218.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/42218.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4f60\u4ee5\u4e3a\u4e91\u5f00\u53d1\u53ea\u662f\u201c\u4e0d\u7528\u914d\u670d\u52a1\u5668\u201d\uff1f\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e91\u5f00\u53d1\u5176\u5b9e\u8fdc\u6bd4\u4f60\u60f3\u7684\u731b\uff01"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/42218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=42218"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/42218\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/42215"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=42218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=42218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=42218"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=42218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}