{"id":29711,"date":"2025-04-20T12:06:17","date_gmt":"2025-04-20T04:06:17","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/29711.html"},"modified":"2025-04-20T12:06:17","modified_gmt":"2025-04-20T04:06:17","slug":"%e3%80%90%e5%ae%9e%e6%88%98%e7%af%87%e7%ab%a0%e3%80%91%e6%b7%b1%e5%85%a5%e6%8e%a2%e8%ae%a8%ef%bc%9a%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%a6%82%e4%bd%95%e5%93%8d%e5%ba%94%e5%89%8d%e7%ab%af%e8%af%b7%e6%b1%82","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/29711.html","title":{"rendered":"\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\u6df1\u5165\u63a2\u8ba8&#xff1a;\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e<\/li>\n<li>\n<ul>\n<li>\u4e00\u3001\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42<\/li>\n<li>\n<ul>\n<li>HTTP \u8bf7\u6c42\u751f\u547d\u5468\u671f\u5168\u89e3\u6790<\/li>\n<li>1.\u524d\u7aef\u53d1\u8d77 HTTP \u8bf7\u6c42&#xff08;\u5173\u952e\u7ec6\u8282\u5f3a\u5316\u7248&#xff09;<\/li>\n<li>2. \u670d\u52a1\u5668\u63a5\u6536\u8bf7\u6c42&#xff08;\u6df1\u5ea6\u4f18\u5316\u7248&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>\u4e8c\u3001\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e&#xff08;\u4f01\u4e1a\u7ea7\u65b9\u6848&#xff09;<\/li>\n<li>\n<ul>\n<li>1. \u9ad8\u7ea7\u6570\u636e\u5b58\u50a8\u65b9\u6848<\/li>\n<li>2. \u4e13\u4e1a\u7ea7\u7ba1\u7406\u754c\u9762<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001\u6027\u80fd\u4f18\u5316\u4e0e\u5b89\u5168\u5b9e\u8df5<\/li>\n<li>\n<ul>\n<li>&#x1f6e1;\ufe0f \u5173\u952e\u5b89\u5168\u63aa\u65bd<\/li>\n<li>&#x1f680; \u6027\u80fd\u4f18\u5316\u6280\u5de7<\/li>\n<\/ul>\n<\/li>\n<li>\u56db\u3001\u5b9e\u6218\u8c03\u8bd5\u6307\u5357<\/li>\n<li>\n<ul>\n<li>&#x1f527; \u6570\u636e\u8ffd\u8e2a\u6280\u5de7<\/li>\n<\/ul>\n<\/li>\n<li>\u4e94\u3001\u603b\u7ed3\u4e0e\u5ef6\u4f38\u9605\u8bfb<\/li>\n<li>\n<ul>\n<li>&#x1f4da; \u63a8\u8350\u5b66\u4e60\u8def\u5f84<\/li>\n<\/ul>\n<\/li>\n<li>\u5173\u952e\u63d0\u793a&#xff1a;\u6240\u6709\u4ee3\u7801\u793a\u4f8b\u5747\u5728 Node.js 16&#043; \u73af\u5883\u4e0b\u6d4b\u8bd5\u901a\u8fc7&#xff0c;\u5efa\u8bae\u7ed3\u5408 Postman \u548c MongoDB Compass \u8fdb\u884c\u5b9e\u8df5\u9a8c\u8bc1<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u6df1\u5165\u63a2\u8ba8&#xff1a;\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e<\/h2>\n<h3>\u4e00\u3001\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42<\/h3>\n<h4>HTTP \u8bf7\u6c42\u751f\u547d\u5468\u671f\u5168\u89e3\u6790<\/h4>\n<p>  #mermaid-svg-3Go6XPNjSYO4mKTy {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-3Go6XPNjSYO4mKTy .error-icon{fill:#552222;}#mermaid-svg-3Go6XPNjSYO4mKTy .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-3Go6XPNjSYO4mKTy .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-3Go6XPNjSYO4mKTy .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-3Go6XPNjSYO4mKTy .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-3Go6XPNjSYO4mKTy .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-3Go6XPNjSYO4mKTy .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-3Go6XPNjSYO4mKTy .marker{fill:#333333;stroke:#333333;}#mermaid-svg-3Go6XPNjSYO4mKTy .marker.cross{stroke:#333333;}#mermaid-svg-3Go6XPNjSYO4mKTy svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-3Go6XPNjSYO4mKTy .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-3Go6XPNjSYO4mKTy .cluster-label text{fill:#333;}#mermaid-svg-3Go6XPNjSYO4mKTy .cluster-label span{color:#333;}#mermaid-svg-3Go6XPNjSYO4mKTy .label text,#mermaid-svg-3Go6XPNjSYO4mKTy span{fill:#333;color:#333;}#mermaid-svg-3Go6XPNjSYO4mKTy .node rect,#mermaid-svg-3Go6XPNjSYO4mKTy .node circle,#mermaid-svg-3Go6XPNjSYO4mKTy .node ellipse,#mermaid-svg-3Go6XPNjSYO4mKTy .node polygon,#mermaid-svg-3Go6XPNjSYO4mKTy .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-3Go6XPNjSYO4mKTy .node .label{text-align:center;}#mermaid-svg-3Go6XPNjSYO4mKTy .node.clickable{cursor:pointer;}#mermaid-svg-3Go6XPNjSYO4mKTy .arrowheadPath{fill:#333333;}#mermaid-svg-3Go6XPNjSYO4mKTy .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-3Go6XPNjSYO4mKTy .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-3Go6XPNjSYO4mKTy .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-3Go6XPNjSYO4mKTy .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-3Go6XPNjSYO4mKTy .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-3Go6XPNjSYO4mKTy .cluster text{fill:#333;}#mermaid-svg-3Go6XPNjSYO4mKTy .cluster span{color:#333;}#mermaid-svg-3Go6XPNjSYO4mKTy div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-3Go6XPNjSYO4mKTy :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;} <\/p>\n<p>         <span id=\"L-L-A-B\" class=\"edgeLabel L-LS-A&#039; L-LE-B\">1. \u6784\u9020\u8bf7\u6c42<\/span> <\/p>\n<p>         <span id=\"L-L-B-C\" class=\"edgeLabel L-LS-B&#039; L-LE-C\">GET<\/span> <\/p>\n<p>         <span id=\"L-L-B-D\" class=\"edgeLabel L-LS-B&#039; L-LE-D\">POST<\/span> <\/p>\n<p>         <span id=\"L-L-D-E\" class=\"edgeLabel L-LS-D&#039; L-LE-E\">2. \u4f20\u8f93\u6570\u636e<\/span> <\/p>\n<p>         <span id=\"L-L-E-F\" class=\"edgeLabel L-LS-E&#039; L-LE-F\">3. \u8def\u7531\u89e3\u6790<\/span> <\/p>\n<p>         <span id=\"L-L-F-G\" class=\"edgeLabel L-LS-F&#039; L-LE-G\">4. \u751f\u6210\u54cd\u5e94<\/span> <\/p>\n<p>         <span id=\"L-L-G-A\" class=\"edgeLabel L-LS-G&#039; L-LE-A\">5. \u6e32\u67d3\u5904\u7406<\/span> <\/p>\n<p>           \u5ba2\u6237\u7aef <\/p>\n<p>           \u8bf7\u6c42\u7c7b\u578b <\/p>\n<p>           \u83b7\u53d6\u8d44\u6e90 <\/p>\n<p>           \u63d0\u4ea4\u6570\u636e <\/p>\n<p>           \u670d\u52a1\u5668 <\/p>\n<p>           \u4e1a\u52a1\u5904\u7406 <\/p>\n<p>           \u8fd4\u56de\u7ed3\u679c <\/p>\n<h4>1.\u524d\u7aef\u53d1\u8d77 HTTP \u8bf7\u6c42&#xff08;\u5173\u952e\u7ec6\u8282\u5f3a\u5316\u7248&#xff09;<\/h4>\n<p>\u25ab\ufe0f \u8bf7\u6c42\u51c6\u5907\u9636\u6bb5 Content-Type \u7684\u5965\u79d8<\/p>\n<p>application\/json: \u7ed3\u6784\u5316\u6570\u636e\u4f20\u8f93<\/p>\n<p>multipart\/form-data: \u6587\u4ef6\u4e0a\u4f20\u4e13\u7528<\/p>\n<p>x-www-form-urlencoded: \u4f20\u7edf\u8868\u5355\u63d0\u4ea4<\/p>\n<p>\u25ab\ufe0f \u5b9e\u6218\u793a\u4f8b\u5347\u7ea7<\/p>\n<p><span class=\"token comment\">\/\/ \u5e26\u8d85\u65f6\u548c\u91cd\u8bd5\u673a\u5236\u7684\u8bf7\u6c42<\/span><br \/>\n<span class=\"token keyword\">async<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token function\">enhancedFetch<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">url<span class=\"token punctuation\">,<\/span> data<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> controller <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">AbortController<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> timeoutId <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">setTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> controller<span class=\"token punctuation\">.<\/span><span class=\"token function\">abort<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">5000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">const<\/span> response <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">await<\/span> <span class=\"token function\">fetch<\/span><span class=\"token punctuation\">(<\/span>url<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token literal-property property\">method<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;POST&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token literal-property property\">headers<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token string-property property\">&#039;Content-Type&#039;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;application\/json&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n                <span class=\"token string-property property\">&#039;Authorization&#039;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;Bearer &lt;token&gt;&#039;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token literal-property property\">body<\/span><span class=\"token operator\">:<\/span> <span class=\"token constant\">JSON<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">stringify<\/span><span class=\"token punctuation\">(<\/span>data<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token literal-property property\">signal<\/span><span class=\"token operator\">:<\/span> controller<span class=\"token punctuation\">.<\/span>signal<br \/>\n        <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">clearTimeout<\/span><span class=\"token punctuation\">(<\/span>timeoutId<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>response<span class=\"token punctuation\">.<\/span>ok<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">Error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">HTTP error! status: <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>response<span class=\"token punctuation\">.<\/span>status<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">await<\/span> response<span class=\"token punctuation\">.<\/span><span class=\"token function\">json<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span>error<span class=\"token punctuation\">)<\/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;\u8bf7\u6c42\u5931\u8d25:&#039;<\/span><span class=\"token punctuation\">,<\/span> error<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u6dfb\u52a0\u91cd\u8bd5\u903b\u8f91<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>2. \u670d\u52a1\u5668\u63a5\u6536\u8bf7\u6c42&#xff08;\u6df1\u5ea6\u4f18\u5316\u7248&#xff09;<\/h4>\n<p>\u25ab\ufe0f \u4e2d\u95f4\u4ef6\u5904\u7406\u6d41\u6c34\u7ebf<\/p>\n<p>  #mermaid-svg-UdMKuVVVqbRmG5hM {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-UdMKuVVVqbRmG5hM .error-icon{fill:#552222;}#mermaid-svg-UdMKuVVVqbRmG5hM .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-UdMKuVVVqbRmG5hM .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-UdMKuVVVqbRmG5hM .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-UdMKuVVVqbRmG5hM .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-UdMKuVVVqbRmG5hM .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-UdMKuVVVqbRmG5hM .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-UdMKuVVVqbRmG5hM .marker{fill:#333333;stroke:#333333;}#mermaid-svg-UdMKuVVVqbRmG5hM .marker.cross{stroke:#333333;}#mermaid-svg-UdMKuVVVqbRmG5hM svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-UdMKuVVVqbRmG5hM .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-UdMKuVVVqbRmG5hM .cluster-label text{fill:#333;}#mermaid-svg-UdMKuVVVqbRmG5hM .cluster-label span{color:#333;}#mermaid-svg-UdMKuVVVqbRmG5hM .label text,#mermaid-svg-UdMKuVVVqbRmG5hM span{fill:#333;color:#333;}#mermaid-svg-UdMKuVVVqbRmG5hM .node rect,#mermaid-svg-UdMKuVVVqbRmG5hM .node circle,#mermaid-svg-UdMKuVVVqbRmG5hM .node ellipse,#mermaid-svg-UdMKuVVVqbRmG5hM .node polygon,#mermaid-svg-UdMKuVVVqbRmG5hM .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-UdMKuVVVqbRmG5hM .node .label{text-align:center;}#mermaid-svg-UdMKuVVVqbRmG5hM .node.clickable{cursor:pointer;}#mermaid-svg-UdMKuVVVqbRmG5hM .arrowheadPath{fill:#333333;}#mermaid-svg-UdMKuVVVqbRmG5hM .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-UdMKuVVVqbRmG5hM .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-UdMKuVVVqbRmG5hM .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-UdMKuVVVqbRmG5hM .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-UdMKuVVVqbRmG5hM .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-UdMKuVVVqbRmG5hM .cluster text{fill:#333;}#mermaid-svg-UdMKuVVVqbRmG5hM .cluster span{color:#333;}#mermaid-svg-UdMKuVVVqbRmG5hM div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-UdMKuVVVqbRmG5hM :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;} <\/p>\n<p>         <span id=\"L-L-A-B\" class=\"edgeLabel L-LS-A&#039; L-LE-B\"><\/span> <\/p>\n<p>         <span id=\"L-L-B-C\" class=\"edgeLabel L-LS-B&#039; L-LE-C\"><\/span> <\/p>\n<p>         <span id=\"L-L-C-D\" class=\"edgeLabel L-LS-C&#039; L-LE-D\"><\/span> <\/p>\n<p>         <span id=\"L-L-D-E\" class=\"edgeLabel L-LS-D&#039; L-LE-E\"><\/span> <\/p>\n<p>         <span id=\"L-L-E-F\" class=\"edgeLabel L-LS-E&#039; L-LE-F\"><\/span> <\/p>\n<p>           \u539f\u59cb\u8bf7\u6c42 <\/p>\n<p>           Body\u89e3\u6790 <\/p>\n<p>           \u8eab\u4efd\u9a8c\u8bc1 <\/p>\n<p>           \u6743\u9650\u6821\u9a8c <\/p>\n<p>           \u4e1a\u52a1\u903b\u8f91 <\/p>\n<p>           \u54cd\u5e94\u683c\u5f0f\u5316 <\/p>\n<p>\u25ab\ufe0f Express \u6700\u4f73\u5b9e\u8df5<\/p>\n<p><span class=\"token keyword\">const<\/span> express <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">require<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;express&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> helmet <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">require<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;helmet&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> rateLimit <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">require<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;express-rate-limit&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">const<\/span> app <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">express<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b89\u5168\u589e\u5f3a\u4e2d\u95f4\u4ef6<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">use<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">helmet<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">use<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">rateLimit<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token literal-property property\">windowMs<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">15<\/span> <span class=\"token operator\">*<\/span> <span class=\"token number\">60<\/span> <span class=\"token operator\">*<\/span> <span class=\"token number\">1000<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token comment\">\/\/ 15\u5206\u949f<\/span><br \/>\n    <span class=\"token literal-property property\">max<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">100<\/span> <span class=\"token comment\">\/\/ \u9650\u6d41100\u6b21<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u81ea\u5b9a\u4e49\u65e5\u5fd7\u4e2d\u95f4\u4ef6<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">use<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">req<span class=\"token punctuation\">,<\/span> res<span class=\"token punctuation\">,<\/span> next<\/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 template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">[<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span><span class=\"token keyword\">new<\/span> <span class=\"token class-name\">Date<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">toISOString<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token string\">] <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>req<span class=\"token punctuation\">.<\/span>method<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token string\"> <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>req<span class=\"token punctuation\">.<\/span>path<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">next<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u8def\u7531\u5904\u7406&#xff08;\u5e26\u9519\u8bef\u5904\u7406&#xff09;<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">post<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;\/api\/data&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">async<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">req<span class=\"token punctuation\">,<\/span> res<span class=\"token punctuation\">,<\/span> next<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">const<\/span> processedData <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">await<\/span> <span class=\"token function\">dataProcessor<\/span><span class=\"token punctuation\">(<\/span>req<span class=\"token punctuation\">.<\/span>body<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        res<span class=\"token punctuation\">.<\/span><span class=\"token function\">json<\/span><span class=\"token punctuation\">(<\/span><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;success&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token literal-property property\">data<\/span><span class=\"token operator\">:<\/span> processedData<span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token literal-property property\">timestamp<\/span><span class=\"token operator\">:<\/span> Date<span class=\"token punctuation\">.<\/span><span class=\"token function\">now<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span>err<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">next<\/span><span class=\"token punctuation\">(<\/span>err<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u7edf\u4e00\u9519\u8bef\u5904\u7406<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5168\u5c40\u9519\u8bef\u5904\u7406<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">use<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">err<span class=\"token punctuation\">,<\/span> req<span class=\"token punctuation\">,<\/span> res<span class=\"token punctuation\">,<\/span> next<\/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>err<span class=\"token punctuation\">.<\/span>stack<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    res<span class=\"token punctuation\">.<\/span><span class=\"token function\">status<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">500<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">json<\/span><span class=\"token punctuation\">(<\/span><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;error&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">message<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;Internal Server Error&#039;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>\u4e8c\u3001\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e&#xff08;\u4f01\u4e1a\u7ea7\u65b9\u6848&#xff09;<\/h3>\n<p>&#x1f4ca; \u6570\u636e\u7ba1\u7406\u67b6\u6784<\/p>\n<p>  #mermaid-svg-3P9M1EKHFHB8g9ei {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-3P9M1EKHFHB8g9ei .error-icon{fill:#552222;}#mermaid-svg-3P9M1EKHFHB8g9ei .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-3P9M1EKHFHB8g9ei .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-3P9M1EKHFHB8g9ei .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-3P9M1EKHFHB8g9ei .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-3P9M1EKHFHB8g9ei .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-3P9M1EKHFHB8g9ei .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-3P9M1EKHFHB8g9ei .marker{fill:#333333;stroke:#333333;}#mermaid-svg-3P9M1EKHFHB8g9ei .marker.cross{stroke:#333333;}#mermaid-svg-3P9M1EKHFHB8g9ei svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-3P9M1EKHFHB8g9ei .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-3P9M1EKHFHB8g9ei .cluster-label text{fill:#333;}#mermaid-svg-3P9M1EKHFHB8g9ei .cluster-label span{color:#333;}#mermaid-svg-3P9M1EKHFHB8g9ei .label text,#mermaid-svg-3P9M1EKHFHB8g9ei span{fill:#333;color:#333;}#mermaid-svg-3P9M1EKHFHB8g9ei .node rect,#mermaid-svg-3P9M1EKHFHB8g9ei .node circle,#mermaid-svg-3P9M1EKHFHB8g9ei .node ellipse,#mermaid-svg-3P9M1EKHFHB8g9ei .node polygon,#mermaid-svg-3P9M1EKHFHB8g9ei .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-3P9M1EKHFHB8g9ei .node .label{text-align:center;}#mermaid-svg-3P9M1EKHFHB8g9ei .node.clickable{cursor:pointer;}#mermaid-svg-3P9M1EKHFHB8g9ei .arrowheadPath{fill:#333333;}#mermaid-svg-3P9M1EKHFHB8g9ei .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-3P9M1EKHFHB8g9ei .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-3P9M1EKHFHB8g9ei .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-3P9M1EKHFHB8g9ei .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-3P9M1EKHFHB8g9ei .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-3P9M1EKHFHB8g9ei .cluster text{fill:#333;}#mermaid-svg-3P9M1EKHFHB8g9ei .cluster span{color:#333;}#mermaid-svg-3P9M1EKHFHB8g9ei div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-3P9M1EKHFHB8g9ei :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;} <\/p>\n<p>         <span id=\"L-L-A-B\" class=\"edgeLabel L-LS-A&#039; L-LE-B\"><\/span> <\/p>\n<p>         <span id=\"L-L-B-C\" class=\"edgeLabel L-LS-B&#039; L-LE-C\"><\/span> <\/p>\n<p>         <span id=\"L-L-C-D\" class=\"edgeLabel L-LS-C&#039; L-LE-D\"><\/span> <\/p>\n<p>         <span id=\"L-L-D-E\" class=\"edgeLabel L-LS-D&#039; L-LE-E\"><\/span> <\/p>\n<p>         <span id=\"L-L-E-F\" class=\"edgeLabel L-LS-E&#039; L-LE-F\"><\/span> <\/p>\n<p>         <span id=\"L-L-F-G\" class=\"edgeLabel L-LS-F&#039; L-LE-G\"><\/span> <\/p>\n<p>           \u524d\u7aef\u63d0\u4ea4 <\/p>\n<p>           API Gateway <\/p>\n<p>           \u6570\u636e\u9a8c\u8bc1 <\/p>\n<p>           \u6570\u636e\u5e93\u5b58\u50a8 <\/p>\n<p>           \u6570\u636e\u7f13\u5b58 <\/p>\n<p>           \u7ba1\u7406\u540e\u53f0 <\/p>\n<p>           \u6570\u636e\u5206\u6790 <\/p>\n<h4>1. \u9ad8\u7ea7\u6570\u636e\u5b58\u50a8\u65b9\u6848<\/h4>\n<p>\u25ab\ufe0f MongoDB \u4f18\u5316\u6280\u5de7<\/p>\n<p><span class=\"token comment\">\/\/ \u6dfb\u52a0\u7d22\u5f15\u4f18\u5316\u67e5\u8be2<\/span><br \/>\nDataSchema<span class=\"token punctuation\">.<\/span><span class=\"token function\">index<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">createdAt<\/span><span class=\"token operator\">:<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u65f6\u95f4\u5012\u5e8f\u7d22\u5f15<\/span><br \/>\nDataSchema<span class=\"token punctuation\">.<\/span><span class=\"token function\">index<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">key<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;text&#039;<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u5168\u6587\u641c\u7d22\u7d22\u5f15<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u6570\u636e\u52a0\u5bc6\u5b58\u50a8<\/span><br \/>\n<span class=\"token keyword\">const<\/span> encryptedSchema <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">mongoose<span class=\"token punctuation\">.<\/span>Schema<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token literal-property property\">sensitiveData<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token literal-property property\">type<\/span><span class=\"token operator\">:<\/span> String<span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">get<\/span><span class=\"token operator\">:<\/span> decryptData<span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">set<\/span><span class=\"token operator\">:<\/span> encryptData<br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h4>2. \u4e13\u4e1a\u7ea7\u7ba1\u7406\u754c\u9762<\/h4>\n<p>\u25ab\ufe0f \u5b89\u5168\u589e\u5f3a\u63aa\u65bd<\/p>\n<p><span class=\"token comment\">\/\/ \u7ba1\u7406\u5458\u8eab\u4efd\u9a8c\u8bc1\u4e2d\u95f4\u4ef6<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token function-variable function\">adminAuth<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">req<span class=\"token punctuation\">,<\/span> res<span class=\"token punctuation\">,<\/span> next<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>req<span class=\"token punctuation\">.<\/span>user <span class=\"token operator\">||<\/span> <span class=\"token operator\">!<\/span>req<span class=\"token punctuation\">.<\/span>user<span class=\"token punctuation\">.<\/span>isAdmin<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> res<span class=\"token punctuation\">.<\/span><span class=\"token function\">status<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">403<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">send<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;Access Denied&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token function\">next<\/span><span class=\"token punctuation\">(<\/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 comment\">\/\/ \u5ba1\u8ba1\u65e5\u5fd7\u4e2d\u95f4\u4ef6<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token function-variable function\">auditLog<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">req<span class=\"token punctuation\">,<\/span> res<span class=\"token punctuation\">,<\/span> next<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    AuditLog<span class=\"token punctuation\">.<\/span><span class=\"token function\">create<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token literal-property property\">action<\/span><span class=\"token operator\">:<\/span> req<span class=\"token punctuation\">.<\/span>method <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#039; &#039;<\/span> <span class=\"token operator\">&#043;<\/span> req<span class=\"token punctuation\">.<\/span>path<span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">user<\/span><span class=\"token operator\">:<\/span> req<span class=\"token punctuation\">.<\/span>user<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">ip<\/span><span class=\"token operator\">:<\/span> req<span class=\"token punctuation\">.<\/span>ip<span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">timestamp<\/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><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">next<\/span><span class=\"token punctuation\">(<\/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>app<span class=\"token punctuation\">.<\/span><span class=\"token function\">get<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;\/admin\/data&#039;<\/span><span class=\"token punctuation\">,<\/span> adminAuth<span class=\"token punctuation\">,<\/span> auditLog<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">async<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">req<span class=\"token punctuation\">,<\/span> res<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u5206\u9875\u67e5\u8be2<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> page <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">parseInt<\/span><span class=\"token punctuation\">(<\/span>req<span class=\"token punctuation\">.<\/span>query<span class=\"token punctuation\">.<\/span>page<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">||<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> limit <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">20<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">[<\/span>results<span class=\"token punctuation\">,<\/span> total<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">await<\/span> Promise<span class=\"token punctuation\">.<\/span><span class=\"token function\">all<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><br \/>\n        DataModel<span class=\"token punctuation\">.<\/span><span class=\"token function\">find<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token punctuation\">.<\/span><span class=\"token function\">sort<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span> <span class=\"token literal-property property\">createdAt<\/span><span class=\"token operator\">:<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token punctuation\">.<\/span><span class=\"token function\">skip<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>page <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">*<\/span> limit<span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token punctuation\">.<\/span><span class=\"token function\">limit<\/span><span class=\"token punctuation\">(<\/span>limit<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        DataModel<span class=\"token punctuation\">.<\/span><span class=\"token function\">countDocuments<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    res<span class=\"token punctuation\">.<\/span><span class=\"token function\">render<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;dataList&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token literal-property property\">data<\/span><span class=\"token operator\">:<\/span> results<span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">pagination<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            page<span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token literal-property property\">totalPages<\/span><span class=\"token operator\">:<\/span> Math<span class=\"token punctuation\">.<\/span><span class=\"token function\">ceil<\/span><span class=\"token punctuation\">(<\/span>total <span class=\"token operator\">\/<\/span> limit<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u25ab\ufe0f \u7ba1\u7406\u754c\u9762\u589e\u5f3a\u529f\u80fd<\/p>\n<p><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">!<\/span><span class=\"token operator\">&#8212;<\/span> \u6570\u636e\u770b\u677f\u793a\u4f8b <span class=\"token operator\">&#8212;<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>div <span class=\"token keyword\">class<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;dashboard&#034;<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span>div <span class=\"token keyword\">class<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;metric-card&#034;<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n        <span class=\"token operator\">&lt;<\/span>h3<span class=\"token operator\">&gt;<\/span>\u4eca\u65e5\u63d0\u4ea4\u91cf<span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>h3<span class=\"token operator\">&gt;<\/span><br \/>\n        <span class=\"token operator\">&lt;<\/span>span <span class=\"token keyword\">class<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;value&#034;<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">%&#061;<\/span> dailyCount <span class=\"token operator\">%<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>span<span class=\"token operator\">&gt;<\/span><br \/>\n        <span class=\"token operator\">&lt;<\/span>div <span class=\"token keyword\">class<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;sparkline&#034;<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>div<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>div<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span>div <span class=\"token keyword\">class<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;metric-card&#034;<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n        <span class=\"token operator\">&lt;<\/span>h3<span class=\"token operator\">&gt;<\/span>\u70ed\u95e8\u5b57\u6bb5\u5206\u5e03<span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>h3<span class=\"token operator\">&gt;<\/span><br \/>\n        <span class=\"token operator\">&lt;<\/span>canvas id<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;keyDistributionChart&#034;<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>canvas<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>div<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>div<span class=\"token operator\">&gt;<\/span><\/p>\n<h3>\u4e09\u3001\u6027\u80fd\u4f18\u5316\u4e0e\u5b89\u5168\u5b9e\u8df5<\/h3>\n<h4>&#x1f6e1;\ufe0f \u5173\u952e\u5b89\u5168\u63aa\u65bd<\/h4>\n<p>\u8f93\u5165\u9a8c\u8bc1&#xff1a;\u4f7f\u7528 Joi \u8fdb\u884c schema \u9a8c\u8bc1<\/p>\n<p>SQL \u6ce8\u5165\u9632\u62a4&#xff1a;\u4f7f\u7528 ORM \u7684\u53c2\u6570\u5316\u67e5\u8be2<\/p>\n<p>XSS \u9632\u62a4&#xff1a;\u81ea\u52a8\u8f6c\u4e49\u6a21\u677f\u53d8\u91cf<\/p>\n<p>CSRF \u9632\u62a4&#xff1a;\u4f7f\u7528 csurf \u4e2d\u95f4\u4ef6<\/p>\n<h4>&#x1f680; \u6027\u80fd\u4f18\u5316\u6280\u5de7<\/h4>\n<p>  #mermaid-svg-L61YvwETtnl6H7Wk {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-L61YvwETtnl6H7Wk .error-icon{fill:#552222;}#mermaid-svg-L61YvwETtnl6H7Wk .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-L61YvwETtnl6H7Wk .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-L61YvwETtnl6H7Wk .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-L61YvwETtnl6H7Wk .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-L61YvwETtnl6H7Wk .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-L61YvwETtnl6H7Wk .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-L61YvwETtnl6H7Wk .marker{fill:#333333;stroke:#333333;}#mermaid-svg-L61YvwETtnl6H7Wk .marker.cross{stroke:#333333;}#mermaid-svg-L61YvwETtnl6H7Wk svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-L61YvwETtnl6H7Wk .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-L61YvwETtnl6H7Wk .cluster-label text{fill:#333;}#mermaid-svg-L61YvwETtnl6H7Wk .cluster-label span{color:#333;}#mermaid-svg-L61YvwETtnl6H7Wk .label text,#mermaid-svg-L61YvwETtnl6H7Wk span{fill:#333;color:#333;}#mermaid-svg-L61YvwETtnl6H7Wk .node rect,#mermaid-svg-L61YvwETtnl6H7Wk .node circle,#mermaid-svg-L61YvwETtnl6H7Wk .node ellipse,#mermaid-svg-L61YvwETtnl6H7Wk .node polygon,#mermaid-svg-L61YvwETtnl6H7Wk .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-L61YvwETtnl6H7Wk .node .label{text-align:center;}#mermaid-svg-L61YvwETtnl6H7Wk .node.clickable{cursor:pointer;}#mermaid-svg-L61YvwETtnl6H7Wk .arrowheadPath{fill:#333333;}#mermaid-svg-L61YvwETtnl6H7Wk .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-L61YvwETtnl6H7Wk .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-L61YvwETtnl6H7Wk .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-L61YvwETtnl6H7Wk .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-L61YvwETtnl6H7Wk .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-L61YvwETtnl6H7Wk .cluster text{fill:#333;}#mermaid-svg-L61YvwETtnl6H7Wk .cluster span{color:#333;}#mermaid-svg-L61YvwETtnl6H7Wk div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-L61YvwETtnl6H7Wk :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;} <\/p>\n<p>         <span id=\"L-L-A-B\" class=\"edgeLabel L-LS-A&#039; L-LE-B\"><\/span> <\/p>\n<p>         <span id=\"L-L-B-C\" class=\"edgeLabel L-LS-B&#039; L-LE-C\"><\/span> <\/p>\n<p>         <span id=\"L-L-C-D\" class=\"edgeLabel L-LS-C&#039; L-LE-D\"><\/span> <\/p>\n<p>         <span id=\"L-L-D-E\" class=\"edgeLabel L-LS-D&#039; L-LE-E\"><\/span> <\/p>\n<p>           \u5ba2\u6237\u7aef\u7f13\u5b58 <\/p>\n<p>           CDN\u52a0\u901f <\/p>\n<p>           \u8d1f\u8f7d\u5747\u8861 <\/p>\n<p>           \u6570\u636e\u5e93\u5206\u7247 <\/p>\n<p>           \u67e5\u8be2\u4f18\u5316 <\/p>\n<h3>\u56db\u3001\u5b9e\u6218\u8c03\u8bd5\u6307\u5357<\/h3>\n<h4>&#x1f527; \u6570\u636e\u8ffd\u8e2a\u6280\u5de7<\/h4>\n<p><span class=\"token comment\">\/\/ \u8c03\u8bd5\u4e2d\u95f4\u4ef6<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">use<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">req<span class=\"token punctuation\">,<\/span> res<span class=\"token punctuation\">,<\/span> next<\/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;Request Body:&#039;<\/span><span class=\"token punctuation\">,<\/span> req<span class=\"token punctuation\">.<\/span>body<span class=\"token punctuation\">)<\/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;Headers:&#039;<\/span><span class=\"token punctuation\">,<\/span> req<span class=\"token punctuation\">.<\/span>headers<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> originalSend <span class=\"token operator\">&#061;<\/span> res<span class=\"token punctuation\">.<\/span>send<span class=\"token punctuation\">;<\/span><br \/>\n    res<span class=\"token punctuation\">.<\/span><span class=\"token function-variable function\">send<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">body<\/span><span class=\"token punctuation\">)<\/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;Response Body:&#039;<\/span><span class=\"token punctuation\">,<\/span> body<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">originalSend<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">call<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">this<\/span><span class=\"token punctuation\">,<\/span> body<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">next<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>\u4e94\u3001\u603b\u7ed3\u4e0e\u5ef6\u4f38\u9605\u8bfb<\/h3>\n<h4>&#x1f4da; \u63a8\u8350\u5b66\u4e60\u8def\u5f84<\/h4>\n<p>\u6df1\u5165\u7406\u89e3 HTTP\/2 \u534f\u8bae<\/p>\n<p>RESTful API \u8bbe\u8ba1\u6700\u4f73\u5b9e\u8df5<\/p>\n<p>GraphQL \u4e0e\u73b0\u4ee3 API \u5f00\u53d1<\/p>\n<p>\u670d\u52a1\u7aef\u6e32\u67d3&#xff08;SSR&#xff09;\u6280\u672f<\/p>\n<p>\u5fae\u670d\u52a1\u67b6\u6784\u4e2d\u7684\u901a\u4fe1\u6a21\u5f0f<\/p>\n<p>  #mermaid-svg-j2cWAGhvmwtWsH3p {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-j2cWAGhvmwtWsH3p .error-icon{fill:#552222;}#mermaid-svg-j2cWAGhvmwtWsH3p .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-j2cWAGhvmwtWsH3p .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-j2cWAGhvmwtWsH3p .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-j2cWAGhvmwtWsH3p .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-j2cWAGhvmwtWsH3p .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-j2cWAGhvmwtWsH3p .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-j2cWAGhvmwtWsH3p .marker{fill:#333333;stroke:#333333;}#mermaid-svg-j2cWAGhvmwtWsH3p .marker.cross{stroke:#333333;}#mermaid-svg-j2cWAGhvmwtWsH3p svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-j2cWAGhvmwtWsH3p .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-j2cWAGhvmwtWsH3p .cluster-label text{fill:#333;}#mermaid-svg-j2cWAGhvmwtWsH3p .cluster-label span{color:#333;}#mermaid-svg-j2cWAGhvmwtWsH3p .label text,#mermaid-svg-j2cWAGhvmwtWsH3p span{fill:#333;color:#333;}#mermaid-svg-j2cWAGhvmwtWsH3p .node rect,#mermaid-svg-j2cWAGhvmwtWsH3p .node circle,#mermaid-svg-j2cWAGhvmwtWsH3p .node ellipse,#mermaid-svg-j2cWAGhvmwtWsH3p .node polygon,#mermaid-svg-j2cWAGhvmwtWsH3p .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-j2cWAGhvmwtWsH3p .node .label{text-align:center;}#mermaid-svg-j2cWAGhvmwtWsH3p .node.clickable{cursor:pointer;}#mermaid-svg-j2cWAGhvmwtWsH3p .arrowheadPath{fill:#333333;}#mermaid-svg-j2cWAGhvmwtWsH3p .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-j2cWAGhvmwtWsH3p .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-j2cWAGhvmwtWsH3p .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-j2cWAGhvmwtWsH3p .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-j2cWAGhvmwtWsH3p .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-j2cWAGhvmwtWsH3p .cluster text{fill:#333;}#mermaid-svg-j2cWAGhvmwtWsH3p .cluster span{color:#333;}#mermaid-svg-j2cWAGhvmwtWsH3p div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-j2cWAGhvmwtWsH3p :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;} <\/p>\n<p>         <span id=\"L-L-A-B\" class=\"edgeLabel L-LS-A&#039; L-LE-B\"><\/span> <\/p>\n<p>         <span id=\"L-L-B-C\" class=\"edgeLabel L-LS-B&#039; L-LE-C\"><\/span> <\/p>\n<p>         <span id=\"L-L-C-D\" class=\"edgeLabel L-LS-C&#039; L-LE-D\"><\/span> <\/p>\n<p>         <span id=\"L-L-D-E\" class=\"edgeLabel L-LS-D&#039; L-LE-E\"><\/span> <\/p>\n<p>           \u57fa\u7840\u4ea4\u4e92 <\/p>\n<p>           \u6027\u80fd\u4f18\u5316 <\/p>\n<p>           \u5b89\u5168\u52a0\u56fa <\/p>\n<p>           \u67b6\u6784\u6269\u5c55 <\/p>\n<p>           \u4e91\u539f\u751f\u90e8\u7f72 <\/p>\n<h3>\u5173\u952e\u63d0\u793a&#xff1a;\u6240\u6709\u4ee3\u7801\u793a\u4f8b\u5747\u5728 Node.js 16&#043; \u73af\u5883\u4e0b\u6d4b\u8bd5\u901a\u8fc7&#xff0c;\u5efa\u8bae\u7ed3\u5408 Postman \u548c MongoDB Compass \u8fdb\u884c\u5b9e\u8df5\u9a8c\u8bc1<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e38\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u6df1\u5165\u7406\u89e3 HTTP\/2 \u534f\u8baeRESTful API \u8bbe\u8ba1\u6700\u4f73\u5b9e\u8df5GraphQL \u4e0e\u73b0\u4ee3 API \u5f00\u53d1\u670d\u52a1\u7aef\u6e32\u67d3\uff08SSR\uff09\u6280\u672f\u5fae\u670d\u52a1\u67b6\u6784\u4e2d\u7684\u901a\u4fe1\u6a21\u5f0ffill:#333;color:#333;color:#333;fill:none;\u57fa\u7840\u4ea4\u4e92\u6027\u80fd\u4f18\u5316\u5b89\u5168\u52a0\u56fa\u67b6\u6784\u6269\u5c55\u4e91\u539f\u751f\u90e8\u7f72\u3002_\u524d\u7aef\u5982\u4f55\u8c03\u8bd5\u8bf7\u6c42\u7684\u54cd\u5e94\u67e5\u770b\u6570\u636e<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[87,371,43,44],"topic":[],"class_list":["post-29711","post","type-post","status-publish","format-standard","hentry","category-server","tag-87","tag-371","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e - \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\/29711.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e38\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u6df1\u5165\u7406\u89e3 HTTP\/2 \u534f\u8baeRESTful API \u8bbe\u8ba1\u6700\u4f73\u5b9e\u8df5GraphQL \u4e0e\u73b0\u4ee3 API \u5f00\u53d1\u670d\u52a1\u7aef\u6e32\u67d3\uff08SSR\uff09\u6280\u672f\u5fae\u670d\u52a1\u67b6\u6784\u4e2d\u7684\u901a\u4fe1\u6a21\u5f0ffill:#333;color:#333;color:#333;fill:none;\u57fa\u7840\u4ea4\u4e92\u6027\u80fd\u4f18\u5316\u5b89\u5168\u52a0\u56fa\u67b6\u6784\u6269\u5c55\u4e91\u539f\u751f\u90e8\u7f72\u3002_\u524d\u7aef\u5982\u4f55\u8c03\u8bd5\u8bf7\u6c42\u7684\u54cd\u5e94\u67e5\u770b\u6570\u636e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/29711.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-20T04:06:17+00:00\" \/>\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=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/29711.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/29711.html\",\"name\":\"\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-20T04:06:17+00:00\",\"dateModified\":\"2025-04-20T04:06:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/29711.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/29711.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/29711.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e\"}]},{\"@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":"\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e - \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\/29711.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e38\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u6df1\u5165\u7406\u89e3 HTTP\/2 \u534f\u8baeRESTful API \u8bbe\u8ba1\u6700\u4f73\u5b9e\u8df5GraphQL \u4e0e\u73b0\u4ee3 API \u5f00\u53d1\u670d\u52a1\u7aef\u6e32\u67d3\uff08SSR\uff09\u6280\u672f\u5fae\u670d\u52a1\u67b6\u6784\u4e2d\u7684\u901a\u4fe1\u6a21\u5f0ffill:#333;color:#333;color:#333;fill:none;\u57fa\u7840\u4ea4\u4e92\u6027\u80fd\u4f18\u5316\u5b89\u5168\u52a0\u56fa\u67b6\u6784\u6269\u5c55\u4e91\u539f\u751f\u90e8\u7f72\u3002_\u524d\u7aef\u5982\u4f55\u8c03\u8bd5\u8bf7\u6c42\u7684\u54cd\u5e94\u67e5\u770b\u6570\u636e","og_url":"https:\/\/www.wsisp.com\/helps\/29711.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-20T04:06:17+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/29711.html","url":"https:\/\/www.wsisp.com\/helps\/29711.html","name":"\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-20T04:06:17+00:00","dateModified":"2025-04-20T04:06:17+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/29711.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/29711.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/29711.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u5b9e\u6218\u7bc7\u7ae0\u3011\u6df1\u5165\u63a2\u8ba8\uff1a\u670d\u52a1\u5668\u5982\u4f55\u54cd\u5e94\u524d\u7aef\u8bf7\u6c42\u53ca\u540e\u7aef\u5982\u4f55\u67e5\u770b\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e"}]},{"@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\/29711","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=29711"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/29711\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=29711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=29711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=29711"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=29711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}