{"id":48510,"date":"2025-07-30T12:16:16","date_gmt":"2025-07-30T04:16:16","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/48510.html"},"modified":"2025-07-30T12:16:16","modified_gmt":"2025-07-30T04:16:16","slug":"%e5%89%8d%e7%ab%af%e8%b7%a8%e5%9f%9f%e5%8d%a1%e8%84%96%e5%ad%90%ef%bc%9f0%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%88%90%e6%9c%ac%ef%bc%8c3%e5%88%86%e9%92%9f%e6%90%9e%e5%ae%9a%ef%bc%81%e9%99%84%e4%bf%9d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/48510.html","title":{"rendered":"\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b)"},"content":{"rendered":"<p style=\"text-align: left\">\u522b\u518d\u4e3aCORS\u62a5\u9519\u6293\u72c2&#xff01;\u6ca1\u6709\u540e\u7aef\u670d\u52a1\u5668&#xff1f;\u4e91\u51fd\u6570\u79d2\u53d8\u4f60\u7684\u514d\u8d39\u201c\u8de8\u57df\u6551\u661f\u201d&#xff01;<\/p>\n<h3>\u4e00 \u7ea2\u8272\u7684CORS\u8de8\u57df\u9519\u8bef<\/h3>\n<p> <img decoding=\"async\" title=\"null\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041606-68899c86603d5.jpg\" \/><\/p>\n<p style=\"text-align: justify\">\u524d\u7aef\u5f00\u53d1\u60f3\u8c03\u4e2a\u7b2c\u4e09\u65b9\u63a5\u53e3&#xff08;\u4f8b\u5982&#xff1a;\u767e\u5ea6\u6587\u5fc3\u4e00\u8a00\u7684API&#xff09;&#xff0c;\u662f\u4e0d\u662f\u7ecf\u5e38\u88ab\u8fd9\u4e2a\u00a0\u7ea2\u8272\u7684CORS\u8de8\u57df\u9519\u8bef\u00a0\u641e\u5f97\u5934\u76ae\u53d1\u9ebb&#xff1f;&#x1f624;<\/p>\n<p style=\"text-align: justify\">\u6ca1\u9519&#xff01;\u6d4f\u89c8\u5668\u51fa\u4e8e\u5b89\u5168\u8003\u8651&#xff0c;\u9ed8\u8ba4\u963b\u6b62\u4e86\u8fd9\u79cd\u201c\u8de8\u57df\u201d\u8bf7\u6c42\u3002\u6700\u6b63\u7edf\u89e3\u6cd5\u5f53\u7136\u662f\u90e8\u7f72\u81ea\u5df1\u7684\u540e\u7aef\u670d\u52a1\u505a\u4ee3\u7406\u3002\u4f46\u662f&#xff01;\u4e0d\u662f\u6bcf\u4e2a\u524d\u7aef\u90fd\u6709\u73b0\u6210\u7684\u540e\u7aef\u670d\u52a1\u5668&#xff0c;\u6216\u8005\u4e3a\u4e86\u4e00\u4e2a\u5c0f\u8c03\u8bd5\u53bb\u6298\u817e\u90e8\u7f72&#xff0c;\u592a\u9ebb\u70e6&#xff01;<\/p>\n<p style=\"text-align: justify\">\u4eca\u5929&#xff0c;\u5c31\u6559\u4f60\u4e00\u4e2a\u8d85\u5b9e\u7528\u3001\u8d85\u4fbf\u6377\u3001\u8fd1\u4e4e\u96f6\u6210\u672c\u7684\u89e3\u51b3\u65b9\u6848\u2014\u2014\u5229\u7528\u817e\u8baf\u4e91\u51fd\u6570&#xff01;\u00a0&#x1f680;<\/p>\n<p style=\"text-align: justify\">\u4e91\u51fd\u6570&#xff0c;\u5c31\u662f\u4f60\u7684\u201c\u4e34\u65f6\u540e\u7aef\u201d\u4ee3\u7406&#xff01;<\/p>\n<p style=\"text-align: justify\">\u5b83\u7684\u6838\u5fc3\u601d\u8def\u5f88\u7b80\u5355&#xff1a;<\/p>\n<li>\n<p>1. \u4f60\u628a\u8bf7\u6c42\u53d1\u7ed9\u90e8\u7f72\u5728\u817e\u8baf\u4e91\u4e0a\u7684\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u51fd\u6570&#xff08;\u4e91\u51fd\u6570&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>2. \u4e91\u51fd\u6570&#xff08;\u5728\u670d\u52a1\u5668\u73af\u5883&#xff0c;\u6ca1\u6709\u8de8\u57df\u9650\u5236&#xff09;\u5e2e\u4f60\u8f6c\u53d1\u8bf7\u6c42\u5230\u76ee\u6807API&#xff08;\u5982\u767e\u5ea6&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>3. \u4e91\u51fd\u6570\u62ff\u5230\u7ed3\u679c\u540e&#xff0c;\u52a0\u4e0a\u5141\u8bb8\u8de8\u57df\u7684\u54cd\u5e94\u5934&#xff0c;\u518d\u8fd4\u56de\u7ed9\u4f60\u7684\u524d\u7aef\u3002<\/p>\n<\/li>\n<p style=\"text-align: justify\">\u597d\u5904\u7b80\u76f4\u4e0d\u8981\u592a\u591a&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u2022 \u2705 \u6781\u901f\u642d\u5efa&#xff1a; \u51e0\u5206\u949f\u641e\u5b9a&#xff0c;\u544a\u522b\u590d\u6742\u90e8\u7f72&#xff01;<\/p>\n<\/li>\n<li>\n<p>\u2022 \u2705 \u96f6\u670d\u52a1\u5668\u6210\u672c&#xff1a; \u817e\u8baf\u4e91\u51fd\u6570\u6709\u4e30\u539a\u7684\u514d\u8d39\u989d\u5ea6&#xff0c;\u50cf\u83b7\u53d6Token\u8fd9\u79cd\u4f4e\u9891\u8c03\u7528&#xff0c;\u57fa\u672c\u4e0d\u7528\u82b1\u94b1&#xff01;(\u5177\u4f53\u8ba1\u8d39\u53c2\u8003\u817e\u8baf\u4e91\u6587\u6863)<\/p>\n<\/li>\n<li>\n<p>\u2022 \u2705 \u4fdd\u62a4\u654f\u611f\u4fe1\u606f&#xff1a; API Key\/Secret \u4e0d\u7528\u5199\u6b7b\u5728\u524d\u7aef\u4ee3\u7801\u91cc&#xff0c;\u5b89\u5168\u653e\u5728\u4e91\u51fd\u6570\u73af\u5883\u53d8\u91cf&#xff01;<\/p>\n<\/li>\n<li>\n<p>\u2022 \u2705 \u4e13\u6ce8\u524d\u7aef&#xff1a; \u89e3\u51b3\u8de8\u57df&#xff0c;\u8ba9\u4f60\u8c03\u8bd5\u66f4\u987a\u7545&#xff01;<\/p>\n<\/li>\n<\/ul>\n<h3>\u4e8c \u624b\u628a\u624b\u6559\u7a0b&#xff1a;\u7528\u817e\u8baf\u4e91\u51fd\u6570\u4ee3\u7406\u767e\u5ea6API\u83b7\u53d6Token (\u901a\u7528\u65b9\u6cd5&#xff0c;\u4e3e\u4e00\u53cd\u4e09&#xff01;)<\/h3>\n<p style=\"text-align: left\">\u6838\u5fc3\u51c6\u5907&#xff1a; \u4e00\u4e2a\u817e\u8baf\u4e91\u8d26\u53f7&#xff08;\u6ce8\u518c\u5f88\u7b80\u5355&#xff09;\u3002<\/p>\n<h5>\u6b65\u9aa41&#xff1a;\u521b\u5efa\u4f60\u7684\u201c\u8de8\u57df\u6551\u661f\u201d\u4e91\u51fd\u6570<\/h5>\n<li>\n<p>1. \u767b\u5f55\u817e\u8baf\u4e91\u63a7\u5236\u53f0&#xff0c;\u627e\u5230 \u300c\u4e91\u51fd\u6570\u300d \u670d\u52a1&#xff0c;\u70b9\u51fb \u300c\u65b0\u5efa\u300d\u3002<\/p>\n<\/li>\n<li>\n<p>2. \u521b\u5efa\u65b9\u5f0f&#xff1a;\u9009\u62e9\u300c\u4ece\u5934\u5f00\u59cb\u300d\u3002<\/p>\n<\/li>\n<li>\n<p>3. \u51fd\u6570\u7c7b\u578b&#xff1a;\u9009\u62e9\u300c\u4e8b\u4ef6\u51fd\u6570\u300d\u3002<\/p>\n<\/li>\n<li>\n<p>4. \u51fd\u6570\u540d&#xff1a;\u8d77\u4e2a\u6709\u610f\u4e49\u7684\u540d\u5b57&#xff0c;\u6bd4\u5982\u00a0GetBaiduTokenProxy\u3002<\/p>\n<\/li>\n<li>\n<p>5. \u5730\u57df&#xff1a;\u9009\u4e2a\u79bb\u4f60\u8fd1\u7684\u5730\u533a&#xff08;\u5982\u5317\u4eac\u3001\u4e0a\u6d77&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>6. \u8fd0\u884c\u73af\u5883&#xff1a;\u9009 Node.js (\u63a8\u8350 16.13 \u6216\u66f4\u65b0\u7a33\u5b9a\u7248)\u3002<\/p>\n<\/li>\n<li>\n<p>7. \u51fd\u6570\u4ee3\u7801&#xff1a;\u9009\u201c\u5728\u7ebf\u7f16\u8f91\u201d&#xff0c;\u300c\u6267\u884c\u65b9\u6cd5\u300d\u8f93\u5165\u201cindex.main\u201d&#xff0c;\u4f60\u7684\u201c\u4e34\u65f6\u540e\u7aef\u201d\u5c31\u5efa\u597d\u4e86&#xff01;\u23f1\ufe0f<\/p>\n<\/li>\n<p> <img decoding=\"async\" title=\"null\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041607-68899c8735521.jpg\" \/><\/p>\n<h5>\u6b65\u9aa42&#xff1a;\u6ce8\u5165\u201c\u7075\u9b42\u201d\u4ee3\u7801<\/h5>\n<p style=\"text-align: justify\">\u8fdb\u5165\u51fd\u6570\u4ee3\u7801\u5728\u7ebf\u7f16\u8f91\u5668&#xff0c;\u628a\u4e0b\u9762\u7684\u6838\u5fc3\u903b\u8f91\u7c98\u8d34\u8fdb\u53bb\u3002\u8fd9\u6bb5\u4ee3\u7801\u7684\u4f5c\u7528\u5c31\u662f\u5b89\u5168\u5730\u8bf7\u6c42\u767e\u5ea6Token API\u5e76\u8fd4\u56de\u5141\u8bb8\u8de8\u57df\u7684\u7ed3\u679c&#xff0c;\u4e14\u4f7f\u7528\u539f\u751fhttp\u5b9e\u73b0&#xff0c;\u4e0d\u9700\u8981\u4efb\u4f55\u989d\u5916\u7684\u5e93\u3002<\/p>\n<p> \/\/ \u5f15\u5165\u5fc5\u8981\u6a21\u5757<br \/>\nconst https &#061; require(&#039;https&#039;);<br \/>\nconst querystring &#061; require(&#039;querystring&#039;);<\/p>\n<p>exports.main &#061; async (event) &#061;&gt; {\u00a0<br \/>\n\u00a0 \u00a0 \/\/ \u5173\u952e&#xff01;\u4ece\u73af\u5883\u53d8\u91cf\u8bfb\u53d6\u654f\u611f\u4fe1\u606f (\u540e\u9762\u8bbe\u7f6e)<br \/>\n\u00a0 \u00a0 const { BAIDU_API_KEY, BAIDU_SECRET_KEY } &#061; process.env;<\/p>\n<p>\u00a0 \u00a0 \/\/ \u51c6\u5907\u8bf7\u6c42\u767e\u5ea6\u7684\u6570\u636e<br \/>\n\u00a0 \u00a0 const postData &#061; querystring.stringify({<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 grant_type: &#039;client_credentials&#039;,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 client_id: BAIDU_API_KEY,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 client_secret: BAIDU_SECRET_KEY<br \/>\n\u00a0 \u00a0 });<\/p>\n<p>\u00a0 \u00a0 \/\/ \u914d\u7f6e\u8bf7\u6c42\u9009\u9879<br \/>\n\u00a0 \u00a0 const options &#061; {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 hostname: &#039;aip.baidubce.com&#039;,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 path: &#039;\/oauth\/2.0\/token&#039;,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 method: &#039;POST&#039;,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 headers: {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#039;Content-Type&#039;: &#039;application\/x-www-form-urlencoded&#039;,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#039;Content-Length&#039;: Buffer.byteLength(postData)<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 }<br \/>\n\u00a0 \u00a0 };<\/p>\n<p>\u00a0 \u00a0 \/\/ \u53d1\u8d77\u8bf7\u6c42\u5e76\u8fd4\u56de\u7ed3\u679c (\u6838\u5fc3\u662f\u8bbe\u7f6e\u8de8\u57df\u5934&#xff01;)<br \/>\n\u00a0 \u00a0 return new Promise((resolve, reject) &#061;&gt; {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 const req &#061; https.request(options, (res) &#061;&gt; {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 let data &#061; &#039;&#039;;<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 res.on(&#039;data&#039;, (chunk) &#061;&gt; data &#043;&#061; chunk);<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 res.on(&#039;end&#039;, () &#061;&gt; {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ \u6210\u529f\u8fd4\u56de&#xff1a;\u72b6\u6001\u7801200 &#043; \u8de8\u57df\u5934 &#043; \u767e\u5ea6\u8fd4\u56de\u7684\u6570\u636e<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 resolve({<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 statusCode: 200,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 headers: {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#039;Access-Control-Allow-Origin&#039;: &#039;*&#039;, \/\/ \u5173\u952e&#xff01;\u5141\u8bb8\u6240\u6709\u6765\u6e90\u8de8\u57df<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#039;Content-Type&#039;: &#039;application\/json&#039;<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 },<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 body: data<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 });<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 });<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 });<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 req.on(&#039;error&#039;, (error) &#061;&gt; {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ \u51fa\u9519\u8fd4\u56de500<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 reject({<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 statusCode: 500,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 body: JSON.stringify({ error: error.message })<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 });<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 });<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 req.write(postData);<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 req.end();<br \/>\n\u00a0 \u00a0 });<br \/>\n};<\/p>\n<p style=\"text-align: left\">\u5212\u91cd\u70b9&#xff1a; \u4ee3\u7801\u4e2d\u7684\u00a0&#039;Access-Control-Allow-Origin&#039;: &#039;*&#039;\u00a0\u5c31\u662f\u89e3\u51b3\u8de8\u57df\u95ee\u9898\u7684\u9b54\u6cd5\u5492\u8bed&#xff01;\u2728<\/p>\n<h5>\u6b65\u9aa43&#xff1a;\u5b88\u62a4\u4f60\u7684\u5bc6\u94a5 &#8211; \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/h5>\n<p style=\"text-align: justify\">\u7edd\u5bf9\u4e0d\u8981\u628a\u00a0API Key\u00a0\u548c\u00a0Secret Key\u00a0\u786c\u7f16\u7801\u5728\u4ee3\u7801\u91cc&#xff01;\u592a\u5371\u9669&#xff01;<\/p>\n<li>\n<p>1. \u5728\u4e91\u51fd\u6570\u63a7\u5236\u53f0&#xff0c;\u627e\u5230\u00a0\u300c\u51fd\u6570\u914d\u7f6e\u300d\u00a0\u9009\u9879\u3002<\/p>\n<\/li>\n<li>\n<p>2. \u627e\u5230\u00a0\u300c\u73af\u5883\u53d8\u91cf\u300d\u00a0\u8bbe\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>3. \u70b9\u51fb\u00a0\u300c\u7f16\u8f91\u300d&#xff0c;\u6dfb\u52a0\u4e24\u6761&#xff1a;<\/p>\n<\/li>\n<ul>\n<li>\n<p>\u2022 \u952e&#xff1a; BAIDU_API_KEY \u503c&#xff1a; \u4f60\u7684\u767e\u5ea6API Key<\/p>\n<\/li>\n<li>\n<p>\u2022 \u952e&#xff1a; BAIDU_SECRET_KEY \u503c&#xff1a; \u4f60\u7684\u767e\u5ea6Secret Key<\/p>\n<\/li>\n<\/ul>\n<li>\n<p>4.\u00a0\u4fdd\u5b58&#xff01;\u00a0&#x1f512;<\/p>\n<\/li>\n<p> <img decoding=\"async\" title=\"null\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041608-68899c8852f7d.jpg\" \/><\/p>\n<h5>\u6b65\u9aa44&#xff1a;\u5f00\u901a\u8bbf\u95ee\u901a\u9053 &#8211; \u914d\u7f6e\u51fd\u6570 URL<\/h5>\n<p style=\"text-align: left\">2025\u5e746\u670830\u65e5\u8d77&#xff0c;\u817e\u8baf\u4e91\u4e0d\u518d\u652f\u6301API\u7f51\u5173\u89e6\u53d1\u5668&#xff0c;\u6539\u7528\u51fd\u6570URL\u4e86\u3002<\/p>\n<p style=\"text-align: justify\">\u73b0\u5728\u9700\u8981\u7ed9\u4f60\u7684\u4e91\u51fd\u6570\u4e00\u4e2a\u516c\u7f51\u8bbf\u95ee\u5730\u5740&#xff0c;\u8ba9\u524d\u7aef\u80fd\u8c03\u7528\u5b83\u3002<\/p>\n<li>\n<p>1. \u5207\u6362\u5230\u00a0\u300c\u51fd\u6570 URL\u300d\u00a0\u9009\u9879\u5361\u3002<\/p>\n<\/li>\n<li>\n<p>2. \u70b9\u51fb\u00a0\u300c\u65b0\u5efa\u51fd\u6570 URL\u300d&#xff0c;\u5982\u4e0b\u56fe\u6240\u793a\u3002<img decoding=\"async\" title=\"null\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041609-68899c8984987.jpg\" \/><\/p>\n<\/p>\n<\/li>\n<li>\n<p>3. \u70b9\u51fb\u300c\u786e\u5b9a\u300d\u3002<\/p>\n<\/li>\n<p>\u7136\u540e\u590d\u5236\u751f\u6210\u7684\u00a0\u516c\u7f51\u8bbf\u95ee\u8def\u5f84&#xff01; \u8fd9\u4e2a\u5c31\u662f\u4f60\u7684\u524d\u7aef\u8981\u8c03\u7528\u7684\u5730\u5740\u4e86&#xff01;<\/p>\n<p> <img decoding=\"async\" title=\"null\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041610-68899c8a9de04.jpg\" \/><\/p>\n<h5>\u6b65\u9aa45&#xff1a;\u672c\u5730\u6d4b\u8bd5\u4e00\u628a<\/h5>\n<p style=\"text-align: justify\">\u5728\u4e91\u51fd\u6570\u4ee3\u7801\u7684\u5728\u7ebf\u7f16\u8f91\u5668\u4e0b\u65b9&#xff0c;\u4f7f\u7528 \u300c\u6d4b\u8bd5\u300d \u529f\u80fd\u6a21\u62df\u8c03\u7528\u4e00\u4e0b\u3002\u5982\u679c\u770b\u5230\u8fd4\u56de\u4e86\u767e\u5ea6\u7684Token\u4fe1\u606f&#xff08;\u5e26 access_token \u5b57\u6bb5&#xff09;&#xff0c;\u606d\u559c\u4f60&#xff01;\u540e\u7aef\u4ee3\u7406\u901a\u9053\u6253\u901a\u4e86&#xff01;&#x1f44f;<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041612-68899c8c7dfce.jpg\" \/><\/p>\n<h5>\u6b65\u9aa46&#xff1a;\u524d\u7aef\u8c03\u7528 &#8211; \u544a\u522b\u8de8\u57df&#xff01;<\/h5>\n<p style=\"text-align: justify\">\u5728\u4f60\u7684\u524d\u7aef\u4ee3\u7801\u91cc&#xff08;\u6bd4\u5982\u7eafJS\/TS\u3001\u6216Vue\/React\/Angular&#xff09;&#xff0c;\u7528\u6700\u719f\u6089\u7684 fetch \u6216 axios \u8c03\u7528\u4f60\u521a\u521a\u590d\u5236\u7684\u90a3\u4e2a\u00a0\u51fd\u6570URL\u00a0\u5c31\u884c\u4e86&#xff01;\u5c31\u50cf\u8c03\u7528\u81ea\u5df1\u7684\u540c\u57df\u63a5\u53e3\u4e00\u6837\u7b80\u5355&#xff01;<\/p>\n<p> \/\/ \u66ff\u6362\u6210\u4f60\u81ea\u5df1\u7684\u4e91\u51fd\u6570URL<br \/>\nconst proxyUrl &#061; &#039;https:\/\/your-awesome-function-url.ap-beijing.tencentscf.com&#039;;<\/p>\n<p>async function getBaiduToken() {<br \/>\n\u00a0 \u00a0 try {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 const response &#061; await fetch(proxyUrl); \/\/ \u76f4\u63a5GET\u8c03\u7528 (\u4e91\u51fd\u6570\u5185\u90e8\u662fPOST\u767e\u5ea6)<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 const data &#061; await response.json();<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 if (data &amp;&amp; data.access_token) {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 console.log(&#039;\u6210\u529f\u83b7\u53d6Token:&#039;, data.access_token);<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return data.access_token;<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 } else {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 throw new Error(&#039;\u83b7\u53d6Token\u5931\u8d25&#xff1a;\u8fd4\u56de\u6570\u636e\u5f02\u5e38&#039;);<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 }<br \/>\n\u00a0 \u00a0 } catch (error) {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 console.error(&#039;\u8c03\u7528\u4e91\u51fd\u6570\u4ee3\u7406\u5931\u8d25:&#039;, error);<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 throw error; \/\/ \u6216\u8fdb\u884c\u9519\u8bef\u5904\u7406<br \/>\n\u00a0 \u00a0 }<br \/>\n}<\/p>\n<p>\/\/ \u4f7f\u7528\u5b83<br \/>\ngetBaiduToken().then(token &#061;&gt; {<br \/>\n\u00a0 \u00a0 \/\/ \u7528token\u53bb\u8c03\u7528\u767e\u5ea6\u5176\u4ed6API\u5427&#xff01;<br \/>\n});<\/p>\n<p style=\"text-align: justify\">\u5927\u529f\u544a\u6210&#xff01;&#x1f389;<\/p>\n<p style=\"text-align: justify\">\u73b0\u5728&#xff0c;\u4f60\u7684\u524d\u7aef\u5e94\u7528\u5c31\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u817e\u8baf\u4e91\u51fd\u6570\u201c\u6865\u6881\u201d&#xff0c;\u7545\u901a\u65e0\u963b\u5730\u8bbf\u95ee\u767e\u5ea6API&#xff08;\u6216\u5176\u4ed6\u4efb\u4f55\u7b2c\u4e09\u65b9API&#xff09;&#xff0c;\u518d\u4e5f\u4e0d\u7528\u770bCORS\u9519\u8bef\u7684\u8138\u8272\u4e86&#xff01;\u800c\u4e14&#xff0c;\u4f60\u7684\u654f\u611f\u5bc6\u94a5\u4e5f\u5b89\u5168\u5730\u85cf\u5728\u4e86\u4e91\u7aef\u3002<\/p>\n<h3>\u4e09 \u603b\u7ed3<\/h3>\n<ul>\n<li>\n<p>\u2022\u00a0\u4e91\u51fd\u6570\u662f\u89e3\u51b3\u524d\u7aef\u5f00\u53d1\u8de8\u57df\u75db\u70b9\u7684\u8f7b\u91cf\u7ea7\u795e\u5668&#xff01;<\/p>\n<\/li>\n<li>\n<p>\u2022\u00a0\u51e0\u5206\u949f\u642d\u5efa&#xff0c;\u51e0\u4e4e\u96f6\u6210\u672c&#xff08;\u514d\u8d39\u989d\u5ea6\u591f\u7528&#xff09;&#xff01;<\/p>\n<\/li>\n<li>\n<p>\u2022\u00a0\u5b89\u5168\u5b58\u50a8\u654f\u611f\u4fe1\u606f&#xff0c;\u524d\u7aef\u4ee3\u7801\u66f4\u5e72\u51c0&#xff01;<\/p>\n<\/li>\n<li>\n<p>\u2022\u00a0\u4e00\u6b21\u642d\u5efa&#xff0c;\u591a\u5904\u53d7\u76ca&#xff08;\u53ef\u4ee3\u7406\u4e0d\u540cAPI&#xff09;&#xff01;<\/p>\n<\/li>\n<\/ul>\n<p style=\"text-align: justify\">\u8d76\u7d27\u6536\u85cf\u8fd9\u7bc7\u4fdd\u59c6\u7ea7\u6559\u7a0b&#xff0c;\u4e0b\u6b21\u9047\u5230\u8de8\u57df\u62e6\u8def\u864e&#xff0c;\u5206\u5206\u949f\u641e\u5b9a\u5b83&#xff01;\u00a0\u89c9\u5f97\u6709\u7528&#xff1f;\u70b9\u8d5e&#x1f44d;\u3001\u5206\u4eab&#x1f4e4; \u7ed9\u4f60\u7684\u5c0f\u4f19\u4f34\u5427&#xff01;\u5927\u5bb6\u8fd8\u7528\u8fc7\u4ec0\u4e48\u5947\u5999\u7684\u8de8\u57df\u89e3\u51b3\u65b9\u6848&#xff1f;\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u8ba8\u8bba~<\/p>\n<h3>\u56db \u8054\u7cfb\u4f5c\u8005<\/h3>\n<ul>\n<li>\n<p>\u2022 \u516c\u4f17\u53f7&#xff1a;\u695a\u6e38\u9999<img decoding=\"async\" title=\"null\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041613-68899c8db7d01.png\" \/><\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u2022 \u4e2a\u4eba\u7f51\u7ad9: https:\/\/www.chuyouxiang.com\/<\/p>\n<\/li>\n<\/ul>\n<p style=\"text-align: justify\">\u4f5c\u8005\u7684\u516c\u4f17\u53f7\u548c\u535a\u5ba2\u4f1a\u4e0d\u5b9a\u671f\u5206\u4eab\u4e00\u4e9b\u6e38\u620f\u5f00\u53d1\u6280\u5de7\u548c\u4e0a\u7ebf\u5b9e\u6218\u7ecf\u9a8c&#xff0c;\u6b22\u8fce\u5173\u6ce8&#xff0c;\u5171\u540c\u8fdb\u6b65&#xff01;<\/p>\n<p style=\"text-align: justify\">\u4f5c\u8005\u540c\u65f6\u521b\u5efa\u4e86\u4e00\u4e2a\u6e38\u620f\u5f00\u53d1\u4ea4\u6d41\u7fa4&#xff0c;\u4f9b\u670b\u53cb\u4eec\u6280\u672f\u4ea4\u6d41\u3001\u5b66\u4e60\u5408\u4f5c\u3001\u95ee\u9898\u6c42\u52a9\u7b49&#xff0c;\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u5173\u6ce8\u6211\u7684\u516c\u4f17\u53f7&#xff0c;\u5e76\u7559\u8a00\u52a0\u7fa4\u3002<\/p>\n<h2>\u5f80\u671f\u6587\u7ae0\u63a8\u8350<\/h2>\n<p style=\"text-align: justify\">10\u5206\u949f\u6253\u901aBlender\u2192Cocos&#xff01;3D\u6e38\u620f\u5efa\u6a21\u6781\u7b80\u5165\u95e8(2&#xff09;10\u5206\u949f\u6253\u901aBlender\u2192Cocos&#xff01;3D\u6e38\u620f\u5efa\u6a21\u6781\u7b80\u5165\u95e8(1&#xff09;\u5982\u4f55\u8ba9CocosCreator3.x\u5f15\u64ce\u542f\u52a8\u63d0\u901f60%CocosCreator3.x\u4e2d\u52a8\u6001\u8d44\u6e90\u7684\u52a0\u8f7d\u539f\u7406\u548c\u91ca\u653e\u65b9\u6848Cocos\u63d2\u4ef6&#xff1a;\u8d85\u5f3a\u56fe\u7247\u538b\u7f29&#xff08;\u5168\u81ea\u52a8\u56fe\u7247\u538b\u7f29\u795e\u5668&#xff09;<\/p>\n<p style=\"text-align: justify\">#\u524d\u7aef\u5f00\u53d1 #\u8de8\u57df\u95ee\u9898 #CORS #\u817e\u8baf\u4e91 #\u4e91\u51fd\u6570 #API\u4ee3\u7406 #\u767e\u5ea6API #\u8c03\u8bd5\u6280\u5de7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb835\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u73b0\u5728\uff0c\u4f60\u7684\u524d\u7aef\u5e94\u7528\u5c31\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u817e\u8baf\u4e91\u51fd\u6570\u201c\u6865\u6881\u201d\uff0c\u7545\u901a\u65e0\u963b\u5730\u8bbf\u95ee\u767e\u5ea6API\uff08\u6216\u5176\u4ed6\u4efb\u4f55\u7b2c\u4e09\u65b9API\uff09\uff0c\u518d\u4e5f\u4e0d\u7528\u770bCORS\u9519\u8bef\u7684\u8138\u8272\u4e86\uff01\u540e\u7aef\u4ee3\u7406\u901a\u9053\u6253\u901a\u4e86\uff01\u8fd9\u6bb5\u4ee3\u7801\u7684\u4f5c\u7528\u5c31\u662f\u5b89\u5168\u5730\u8bf7\u6c42\u767e\u5ea6Token API\u5e76\u8fd4\u56de\u5141\u8bb8\u8de8\u57df\u7684\u7ed3\u679c\uff0c\u4e14\u4f7f\u7528\u539f\u751fhttp\u5b9e\u73b0\uff0c\u4e0d\u9700\u8981\u4efb\u4f55\u989d\u5916\u7684\u5e93\u3002\u5728\u4f60\u7684\u524d\u7aef\u4ee3\u7801\u91cc\uff08\u6bd4\u5982\u7eafJS\/TS\u3001\u6216Vue\/React\/Angular\uff09\uff0c\u7528\u6700\u719f\u6089\u7684 fetch \u6216 axios \u8c03\u7528\u4f60\u521a\u521a\u590d\u5236\u7684\u90a3\u4e2a\u30027. \u51fd\u6570\u4ee3\u7801\uff1a\u9009\u201c\u5728\u7ebf\u7f16\u8f91\u201d\uff0c\u300c\u6267\u884c\u65b9\u6cd5\u300d\u8f93\u5165\u201cindex.main\u201d\uff0c\u4f60\u7684\u201c\u4e34\u65f6\u540e\u7aef\u201d\u5c31\u5efa\u597d\u4e86\uff01<\/p>\n","protected":false},"author":2,"featured_media":48497,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[87,43,44],"topic":[],"class_list":["post-48510","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-87","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>\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b) - \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\/48510.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb835\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u73b0\u5728\uff0c\u4f60\u7684\u524d\u7aef\u5e94\u7528\u5c31\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u817e\u8baf\u4e91\u51fd\u6570\u201c\u6865\u6881\u201d\uff0c\u7545\u901a\u65e0\u963b\u5730\u8bbf\u95ee\u767e\u5ea6API\uff08\u6216\u5176\u4ed6\u4efb\u4f55\u7b2c\u4e09\u65b9API\uff09\uff0c\u518d\u4e5f\u4e0d\u7528\u770bCORS\u9519\u8bef\u7684\u8138\u8272\u4e86\uff01\u540e\u7aef\u4ee3\u7406\u901a\u9053\u6253\u901a\u4e86\uff01\u8fd9\u6bb5\u4ee3\u7801\u7684\u4f5c\u7528\u5c31\u662f\u5b89\u5168\u5730\u8bf7\u6c42\u767e\u5ea6Token API\u5e76\u8fd4\u56de\u5141\u8bb8\u8de8\u57df\u7684\u7ed3\u679c\uff0c\u4e14\u4f7f\u7528\u539f\u751fhttp\u5b9e\u73b0\uff0c\u4e0d\u9700\u8981\u4efb\u4f55\u989d\u5916\u7684\u5e93\u3002\u5728\u4f60\u7684\u524d\u7aef\u4ee3\u7801\u91cc\uff08\u6bd4\u5982\u7eafJS\/TS\u3001\u6216Vue\/React\/Angular\uff09\uff0c\u7528\u6700\u719f\u6089\u7684 fetch \u6216 axios \u8c03\u7528\u4f60\u521a\u521a\u590d\u5236\u7684\u90a3\u4e2a\u30027. \u51fd\u6570\u4ee3\u7801\uff1a\u9009\u201c\u5728\u7ebf\u7f16\u8f91\u201d\uff0c\u300c\u6267\u884c\u65b9\u6cd5\u300d\u8f93\u5165\u201cindex.main\u201d\uff0c\u4f60\u7684\u201c\u4e34\u65f6\u540e\u7aef\u201d\u5c31\u5efa\u597d\u4e86\uff01\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/48510.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T04:16:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041606-68899c86603d5.jpg\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/48510.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/48510.html\",\"name\":\"\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T04:16:16+00:00\",\"dateModified\":\"2025-07-30T04:16:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/48510.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/48510.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/48510.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b)\"}]},{\"@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":"\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b) - \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\/48510.html","og_locale":"zh_CN","og_type":"article","og_title":"\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb835\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u73b0\u5728\uff0c\u4f60\u7684\u524d\u7aef\u5e94\u7528\u5c31\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u817e\u8baf\u4e91\u51fd\u6570\u201c\u6865\u6881\u201d\uff0c\u7545\u901a\u65e0\u963b\u5730\u8bbf\u95ee\u767e\u5ea6API\uff08\u6216\u5176\u4ed6\u4efb\u4f55\u7b2c\u4e09\u65b9API\uff09\uff0c\u518d\u4e5f\u4e0d\u7528\u770bCORS\u9519\u8bef\u7684\u8138\u8272\u4e86\uff01\u540e\u7aef\u4ee3\u7406\u901a\u9053\u6253\u901a\u4e86\uff01\u8fd9\u6bb5\u4ee3\u7801\u7684\u4f5c\u7528\u5c31\u662f\u5b89\u5168\u5730\u8bf7\u6c42\u767e\u5ea6Token API\u5e76\u8fd4\u56de\u5141\u8bb8\u8de8\u57df\u7684\u7ed3\u679c\uff0c\u4e14\u4f7f\u7528\u539f\u751fhttp\u5b9e\u73b0\uff0c\u4e0d\u9700\u8981\u4efb\u4f55\u989d\u5916\u7684\u5e93\u3002\u5728\u4f60\u7684\u524d\u7aef\u4ee3\u7801\u91cc\uff08\u6bd4\u5982\u7eafJS\/TS\u3001\u6216Vue\/React\/Angular\uff09\uff0c\u7528\u6700\u719f\u6089\u7684 fetch \u6216 axios \u8c03\u7528\u4f60\u521a\u521a\u590d\u5236\u7684\u90a3\u4e2a\u30027. \u51fd\u6570\u4ee3\u7801\uff1a\u9009\u201c\u5728\u7ebf\u7f16\u8f91\u201d\uff0c\u300c\u6267\u884c\u65b9\u6cd5\u300d\u8f93\u5165\u201cindex.main\u201d\uff0c\u4f60\u7684\u201c\u4e34\u65f6\u540e\u7aef\u201d\u5c31\u5efa\u597d\u4e86\uff01","og_url":"https:\/\/www.wsisp.com\/helps\/48510.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T04:16:16+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730041606-68899c86603d5.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/48510.html","url":"https:\/\/www.wsisp.com\/helps\/48510.html","name":"\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T04:16:16+00:00","dateModified":"2025-07-30T04:16:16+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/48510.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/48510.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/48510.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u524d\u7aef\u8de8\u57df\u5361\u8116\u5b50\uff1f0\u670d\u52a1\u5668\u6210\u672c\uff0c3\u5206\u949f\u641e\u5b9a\uff01(\u9644\u4fdd\u59c6\u7ea7\u6559\u7a0b)"}]},{"@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\/48510","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=48510"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/48510\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/48497"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=48510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=48510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=48510"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=48510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}