{"id":122505,"date":"2026-11-05T01:16:50","date_gmt":"2026-11-04T17:16:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/122505.html"},"modified":"2026-11-05T01:16:50","modified_gmt":"2026-11-04T17:16:50","slug":"%e3%80%90%e9%b8%bf%e8%92%99%e5%bf%83%e8%bf%b9%e3%80%91%e7%ab%af%e4%ba%91%e5%8d%8f%e5%90%8c%e8%b8%a9%e5%9d%91%e5%bd%95%ef%bc%9aharmonyos-7-%e5%ba%94%e7%94%a8%e8%b0%83%e5%90%8e%e7%ab%af-api%ef%bc%8c","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/122505.html","title":{"rendered":"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39"},"content":{"rendered":"<hr \/>\n<h2>\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55&#xff1a;HarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API&#xff0c;\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39<\/h2>\n<hr \/>\n<p>\u514d\u8d23\u58f0\u660e&#xff1a;\u672c\u6587\u4e3a\u4e2a\u4eba\u5f00\u53d1\u7b14\u8bb0&#xff0c;\u73af\u5883\u4e3a HarmonyOS 7.x&#xff08;API 26&#xff09;\/ DevEco Studio 5.x&#xff0c;\u540e\u7aef\u4e3a Nginx &#043; \u81ea\u5efa API\u3002\u4e0d\u540c API \u7248\u672c\u884c\u4e3a\u53ef\u80fd\u6709\u5dee\u5f02&#xff0c;\u8bf7\u4ee5\u5b98\u65b9\u6587\u6863\u4e3a\u51c6\u3002<\/p>\n<h3>\u8d77\u56e0&#xff1a;\u672c\u5730\u80fd\u8dd1&#xff0c;\u771f\u673a\u767d\u5c4f<\/h3>\n<p>App \u4e1a\u52a1\u903b\u8f91\u5199\u5b8c&#xff0c;\u63a5\u53e3\u4e00\u63a5\u5c31\u7ffb\u8f66&#xff1a;Previewer \u91cc mock \u6570\u636e\u4e00\u5207\u6b63\u5e38&#xff0c;\u771f\u673a\u4e0a\u4e00\u7247\u7a7a\u767d\u3002\u670d\u52a1\u7aef Nginx access log \u91cc\u8fde\u4e00\u6761\u8bf7\u6c42\u90fd\u6ca1\u6709\u2014\u2014\u8bf4\u660e\u8bf7\u6c42\u6839\u672c\u6ca1\u53d1\u51fa\u53bb\u3002<\/p>\n<p>\u8fd9\u7c7b&#034;\u7aef\u4e0a\u6ca1\u53d1\u3001\u670d\u52a1\u7aef\u6ca1\u6536&#034;\u7684\u95ee\u9898&#xff0c;\u6211\u628a\u6392\u67e5\u987a\u5e8f\u56fa\u5b9a\u4e0b\u6765\u4e86&#xff1a;\u7f51\u7edc\u6743\u9650 \u2192 \u7f51\u7edc\u7b56\u7565 \u2192 \u8bc1\u4e66 \u2192 \u9274\u6743\u4e0e\u53c2\u6570\u3002\u6211\u8fd9\u6b21\u6b63\u597d\u56db\u4e2a\u5168\u8e29\u4e86\u4e00\u904d\u3002<\/p>\n<h3>\u5751\u4e00&#xff1a;\u8bf7\u6c42\u6ca1\u53d1\u51fa\u53bb&#xff0c;\u65e5\u5fd7\u5374\u53ea\u5b57\u4e0d\u63d0\u6743\u9650<\/h3>\n<p>\u73b0\u8c61&#xff1a;http.createHttp().request() \u76f4\u63a5\u8fdb err \u56de\u8c03&#xff0c;\u63a7\u5236\u53f0\u4fe1\u606f\u542b\u7cca\u3002<\/p>\n<p>\u6839\u56e0&#xff1a;module.json5 \u91cc\u6ca1\u58f0\u660e\u7f51\u7edc\u6743\u9650\u3002\u8fd9\u662f\u9e3f\u8499\u548c Android \u7b2c\u4e00\u4e2a\u5dee\u5f02\u2014\u2014Android \u7684 INTERNET \u662f\u666e\u901a\u6743\u9650&#xff08;\u58f0\u660e\u5373\u7ed9&#xff09;&#xff0c;\u9e3f\u8499\u8fd9\u8fb9\u5fc5\u987b\u663e\u5f0f\u58f0\u660e&#xff1a;<\/p>\n<p>\/\/ entry\/src\/main\/module.json5<br \/>\n{<br \/>\n  &#034;module&#034;: {<br \/>\n    &#034;requestPermissions&#034;: [<br \/>\n      { &#034;name&#034;: &#034;ohos.permission.INTERNET&#034; }<br \/>\n    ]<br \/>\n  }<br \/>\n}<\/p>\n<p>\u5224\u65ad\u6280\u5de7&#xff1a;\u5148\u770b\u670d\u52a1\u7aef\u6709\u6ca1\u6709\u6536\u5230\u8bf7\u6c42\u3002\u670d\u52a1\u7aef\u65e0\u65e5\u5fd7 &#061; \u7aef\u4e0a\u95ee\u9898&#xff08;\u6743\u9650\/\u7f51\u7edc\/\u5d29\u6e83&#xff09;&#xff1b;\u670d\u52a1\u7aef\u6709\u65e5\u5fd7 &#061; \u670d\u52a1\u7aef\u95ee\u9898&#xff08;\u9274\u6743\/\u53c2\u6570\/\u8d85\u65f6&#xff09;\u3002\u8fd9\u4e00\u6761\u80fd\u7701\u6389\u4e00\u534a\u6392\u67e5\u65f6\u95f4\u3002<\/p>\n<h3>\u5751\u4e8c&#xff1a;\u660e\u6587 HTTP \u88ab\u62e6&#xff0c;\u4ee5\u53ca\u90a3\u4e24\u4e2a\u9ed8\u8ba4\u6253\u5f00\u7684\u5f00\u5173<\/h3>\n<p>\u6d4b\u8bd5\u73af\u5883\u63a5\u53e3\u662f http:\/\/&#xff0c;\u771f\u673a\u8bf7\u6c42\u5168\u6302\u3002<\/p>\n<p>\u89e3\u6cd5\u4e24\u6761\u8def&#xff0c;\u6211\u63a8\u8350\u7b2c\u4e8c\u6761&#xff1a;<\/p>\n<p>\u65b9\u6848 A&#xff08;\u4e34\u65f6\u653e\u884c&#xff09;&#xff1a;\u5728 entry\/src\/main\/resources\/base\/profile\/ \u4e0b\u5efa network_config.json&#xff0c;\u653e\u884c\u6307\u5b9a\u8c03\u8bd5\u57df\u540d&#xff1a;<\/p>\n<p>\/\/ entry\/src\/main\/resources\/base\/profile\/network_config.json<br \/>\n{<br \/>\n  &#034;network-security-config&#034;: {<br \/>\n    &#034;base-config&#034;: {<br \/>\n      &#034;cleartextTrafficPermitted&#034;: false       \/\/ \u751f\u4ea7\u73af\u5883\u7981\u6b62\u660e\u6587<br \/>\n    },<br \/>\n    &#034;domain-config&#034;: [<br \/>\n      {<br \/>\n        &#034;domains&#034;: [{ &#034;include-subdomains&#034;: true, &#034;name&#034;: &#034;test.example.com&#034; }],<br \/>\n        &#034;cleartextTrafficPermitted&#034;: true      \/\/ \u4ec5\u8c03\u8bd5\u57df\u540d\u653e\u884c<br \/>\n      }<br \/>\n    ]<br \/>\n  },<br \/>\n  &#034;trust-global-user-ca&#034;: false,   \/\/ \u4e0d\u4fe1\u4efb MDM\/\u8bbe\u5907\u7ba1\u7406\u5458\u5b89\u88c5\u7684 CA&#xff0c;\u9ed8\u8ba4 true<br \/>\n  &#034;trust-current-user-ca&#034;: false   \/\/ \u4e0d\u4fe1\u4efb\u5f53\u524d\u7528\u6237\u5b89\u88c5\u7684 CA&#xff0c;\u9ed8\u8ba4 true<br \/>\n}<\/p>\n<p>\u4e24\u4e2a\u7ec6\u8282\u7279\u522b\u5bb9\u6613\u8e29&#xff1a;<\/p>\n<li>trust-global-user-ca \u548c trust-current-user-ca \u662f\u9876\u5c42\u5b57\u6bb5&#xff0c;\u4e0e network-security-config \u5e73\u7ea7\u3001\u5728\u5b83\u5916\u9762\u3002\u6211\u4e00\u5f00\u59cb\u585e\u8fdb\u4e86 base-config \u91cc&#xff0c;\u914d\u7f6e\u5b8c\u5168\u4e0d\u751f\u6548&#xff0c;\u6392\u67e5\u4e86\u534a\u5929\u2014\u2014\u8fd9\u4e24\u4e2a\u5b57\u6bb5\u9ed8\u8ba4\u90fd\u662f true&#xff0c;\u4e5f\u5c31\u662f\u9ed8\u8ba4\u4fe1\u4efb\u7528\u6237\u81ea\u884c\u5b89\u88c5\u7684 CA \u8bc1\u4e66\u3002\u8bbe\u5907\u4e00\u65e6\u88ab\u88c5\u4e0a\u6076\u610f\u8bc1\u4e66&#xff0c;HTTPS \u6d41\u91cf\u53ef\u80fd\u88ab\u89e3\u5bc6&#xff0c;\u751f\u4ea7\u73af\u5883\u52a1\u5fc5\u663e\u5f0f\u5173\u6389\u3002<\/li>\n<li>\u5f15\u7528\u8981\u5199\u5728 module.json5 \u7684 metadata \u8282\u70b9\u91cc&#xff0c;\u4e0d\u662f\u9876\u5c42\u5b57\u6bb5&#xff1a;<\/li>\n<p>{<br \/>\n  &#034;module&#034;: {<br \/>\n    &#034;metadata&#034;: [<br \/>\n      {<br \/>\n        &#034;name&#034;: &#034;ohos.network.security.config&#034;,<br \/>\n        &#034;resource&#034;: &#034;$profile:network_config&#034;<br \/>\n      }<br \/>\n    ]<br \/>\n  }<br \/>\n}<\/p>\n<p>\u914d\u7f6e\u4f18\u5148\u7ea7\u662f component-config &gt; domain-config &gt; base-config&#xff0c;\u6240\u4ee5&#034;base \u5168\u7981 &#043; domain \u5355\u72ec\u653e\u884c&#034;\u6210\u7acb\u3002\u6539\u5b8c\u5fc5\u987b\u91cd\u65b0\u7f16\u8bd1\u6253\u5305&#xff0c;\u70ed\u91cd\u8f7d\u4e0d\u4e00\u5b9a\u751f\u6548\u3002<\/p>\n<p>\u65b9\u6848 B&#xff08;\u63a8\u8350&#xff09;&#xff1a;\u7ed9\u6d4b\u8bd5\u73af\u5883\u76f4\u63a5\u4e0a HTTPS\u3002\u53cd\u6b63\u6b63\u5f0f\u73af\u5883\u8fdf\u65e9\u8981\u4e0a&#xff0c;\u65e9\u4e00\u5929\u4e0a\u5c31\u5c11\u4e00\u6b21&#034;\u5f00\u53d1\u80fd\u8dd1\u3001\u4e0a\u7ebf\u5c31\u70b8&#034;\u3002<\/p>\n<p>\u6293\u5305\u76f8\u5173\u7684\u526f\u4f5c\u7528&#xff1a;\u4e0a\u9762\u4e24\u4e2a\u5f00\u5173\u5173\u6389\u540e&#xff0c;Charles \/ mitmproxy \u5c31\u6293\u4e0d\u5230\u660e\u6587\u4e86\u3002\u8c03\u8bd5\u671f\u7528\u4e34\u65f6\u914d\u7f6e\u653e\u884c&#xff0c;\u4e0a\u67b6\u524d\u52a1\u5fc5\u6539\u56de\u6765\u3002<\/p>\n<h3>\u5751\u4e09&#xff1a;SSL \u63e1\u624b\u5931\u8d25\u2014\u2014\u5751\u5728\u4e2d\u95f4\u8bc1\u4e66<\/h3>\n<p>\u6b63\u5f0f\u73af\u5883\u5207 HTTPS \u540e\u771f\u673a\u62a5 SSL \u63e1\u624b\u5931\u8d25&#xff0c;\u4f46\u6d4f\u89c8\u5668\u8bbf\u95ee\u540c\u4e00\u57df\u540d\u5b8c\u5168\u6b63\u5e38\u3002<\/p>\n<p>\u6839\u56e0&#xff1a;\u8bc1\u4e66\u94fe\u4e0d\u5b8c\u6574\u2014\u2014\u670d\u52a1\u7aef\u53ea\u914d\u4e86\u7ad9\u70b9\u8bc1\u4e66&#xff0c;\u6ca1\u914d\u4e2d\u95f4\u8bc1\u4e66\u3002\u6d4f\u89c8\u5668\u4f1a\u81ea\u52a8\u8865\u5168\u94fe&#xff08;AIA \u8ffd\u94fe&#xff09;&#xff0c;\u800c\u79fb\u52a8\u7aef\u7684 TLS \u5b9e\u73b0\u901a\u5e38\u4e0d\u505a\u8fd9\u4e2a\u52a8\u4f5c\u3002<\/p>\n<p>\u8fd9\u4e2a\u5751\u6211\u5728\u670d\u52a1\u7aef\u6587\u7ae0\u91cc\u5199\u8fc7&#xff0c;\u6ca1\u60f3\u5230\u5728\u9e3f\u8499\u7aef\u4e0a\u53c8\u9047\u5230\u4e00\u6b21\u3002\u68c0\u67e5\u4e0e\u4fee\u590d&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u770b\u670d\u52a1\u7aef\u5b9e\u9645\u53d1\u51fa\u7684\u94fe<\/span><br \/>\nopenssl s_client <span class=\"token parameter variable\">-connect<\/span> api.example.com:443 <span class=\"token parameter variable\">-servername<\/span> api.example.com<\/p>\n<p><span class=\"token comment\"># \u6b63\u786e\u914d\u7f6e&#xff1a;\u7ad9\u70b9\u8bc1\u4e66 &#043; \u4e2d\u95f4\u8bc1\u4e66\u5408\u5e76\u4e3a\u4e00\u4e2a fullchain<\/span><br \/>\n<span class=\"token function\">cat<\/span> your_domain.crt intermediate.crt <span class=\"token operator\">&gt;<\/span> fullchain.pem<\/p>\n<p>Nginx \u91cc ssl_certificate \u8981\u6307\u5411 fullchain.pem&#xff0c;\u4e0d\u662f\u5355\u72ec\u7684\u7ad9\u70b9\u8bc1\u4e66\u3002\u8fd9\u7c7b\u95ee\u9898\u5728\u670d\u52a1\u7aef\u8865\u5168\u8bc1\u4e66\u94fe\u5373\u53ef&#xff0c;\u4e0d\u9700\u8981\u5728\u5ba2\u6237\u7aef\u52a8\u4fe1\u4efb\u951a\u3002<\/p>\n<p>\u987a\u5e26\u63d0\u9192&#xff1a;\u8bc1\u4e66\u6709\u6548\u671f\u5728\u5f80 45 \u5929\u751a\u81f3\u66f4\u77ed\u6f14\u8fdb&#xff0c;\u7aef\u4e0a\u65e0\u611f\u77e5&#xff0c;\u4f46\u670d\u52a1\u7aef\u5fc5\u987b\u628a\u5230\u671f\u76d1\u63a7\u505a\u5230\u4f4d\u2014\u2014\u6309\u5269\u4f59\u6bd4\u4f8b\u544a\u8b66&#xff08;\u6bd4\u5982\u5269\u4f59 30% \u5c31\u544a\u8b66&#xff09;&#xff0c;\u522b\u7b49\u8fc7\u671f\u4e86\u5168\u7ebf 502\u3002<\/p>\n<h3>\u5751\u56db&#xff1a;\u9274\u6743\u522b\u6563\u843d\u5728\u4e1a\u52a1\u9875\u9762\u91cc\u2014\u2014\u7528\u62e6\u622a\u5668\u7edf\u4e00\u6ce8\u5165<\/h3>\n<p>\u73b0\u8c61&#xff1a;\u767b\u5f55\u63a5\u53e3\u901a\u4e86\u4e4b\u540e&#xff0c;\u6211\u4e00\u5f00\u59cb\u5728\u6bcf\u4e2a\u4e1a\u52a1\u8bf7\u6c42\u91cc\u624b\u52a8\u585e Authorization \u5934\u3002\u5341\u51e0\u4e2a\u63a5\u53e3\u5199\u5b8c&#xff0c;Token \u5237\u65b0\u903b\u8f91\u5df2\u7ecf\u5728\u56db\u4e2a\u5730\u65b9\u5404\u5199\u4e86\u4e00\u904d&#xff0c;\u6539\u4e00\u6b21\u8981\u627e\u56db\u5904\u3002<\/p>\n<p>\u6b63\u786e\u505a\u6cd5&#xff1a;\u8bf7\u6c42\u5c42\u7edf\u4e00\u5c01\u88c5&#xff0c;\u9274\u6743\u5934\u3001\u65e5\u5fd7\u3001\u91cd\u8bd5\u5168\u653e\u62e6\u622a\u5668\u91cc&#xff0c;\u4e1a\u52a1\u4ee3\u7801\u53ea\u7ba1\u4f20 URL \u548c\u53c2\u6570&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ \u7edf\u4e00\u5728\u62e6\u622a\u5668\u91cc\u6ce8\u5165&#xff0c;\u4e1a\u52a1\u4fa7\u65e0\u611f<\/span><br \/>\nsessionConfig<span class=\"token punctuation\">.<\/span>interceptors <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">async<\/span> <span class=\"token function\">onRequest<\/span><span class=\"token punctuation\">(<\/span>req<span class=\"token operator\">:<\/span> rcp<span class=\"token punctuation\">.<\/span>Request<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    req<span class=\"token punctuation\">.<\/span>headers <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token operator\">&#8230;<\/span>req<span class=\"token punctuation\">.<\/span>headers<span class=\"token punctuation\">,<\/span><br \/>\n      Authorization<span class=\"token operator\">:<\/span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">Bearer <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span><span class=\"token keyword\">await<\/span> <span class=\"token function\">getToken<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string-property property\">&#039;X-Request-ID&#039;<\/span><span class=\"token operator\">:<\/span> <span class=\"token function\">genId<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>      <span class=\"token comment\">\/\/ \u8d2f\u7a7f\u7aef\u4e91\u7684 requestId<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> req<span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>401 \u5904\u7406\u5efa\u8bae&#xff1a;\u5728\u62e6\u622a\u5668\u7684 onError \u91cc\u7edf\u4e00\u62e6 401&#xff0c;\u89e6\u53d1\u4e00\u6b21\u5237\u65b0\u540e\u91cd\u653e\u539f\u8bf7\u6c42&#xff1b;\u5237\u65b0\u5931\u8d25\u518d\u8df3\u767b\u5f55\u3002\u522b\u8ba9\u5237\u65b0\u903b\u8f91\u6563\u843d\u5728\u4e1a\u52a1\u9875\u9762\u91cc\u3002<\/p>\n<p>\u51ed\u636e\u5b58\u50a8\u63d0\u793a&#xff1a;Token \u4e0d\u8981\u76f4\u63a5\u843d Preferences\u2014\u2014\u5b83\u662f\u660e\u6587 KV&#xff0c;\u5b89\u5168\u6027\u9760\u6c99\u7bb1\u9694\u79bb&#xff0c;\u6321\u4e0d\u4f4f root \u8bbe\u5907\u548c\u5907\u4efd\u63d0\u53d6\u3002\u6b63\u786e\u505a\u6cd5\u662f\u8d70\u7cfb\u7edf\u5b89\u5168\u80fd\u529b&#xff1a;\u7528 HUKS \u751f\u6210 AES-256-GCM \u5bc6\u94a5&#xff0c;\u52a0\u5bc6\u540e\u5199\u5165 el2 \u52a0\u5bc6\u76ee\u5f55&#xff0c;\u53d6\u7528\u65f6\u518d\u89e3\u5bc6\u3002\u8fd9\u5757\u7ad9\u5185\u5df2\u6709\u4e13\u95e8\u6587\u7ae0&#xff0c;\u4e0d\u91cd\u590d\u5c55\u5f00\u3002<\/p>\n<h3>\u5751\u4e94&#xff1a;\u4ece http \u6a21\u5757\u8fc1\u5230 RCP \u7684\u4e09\u4e2a\u6ce8\u610f\u70b9<\/h3>\n<p>\u8001\u5199\u6cd5\u662f\u6bcf\u4e2a\u8bf7\u6c42 createHttp \u2192 request \u2192 destroy \u4e09\u4ef6\u5957&#xff0c;\u529f\u80fd\u6ca1\u6bdb\u75c5&#xff0c;\u4f46\u6709\u4e24\u4e2a\u9690\u60a3&#xff1a;destroy \u65f6\u673a\u4e0d\u597d\u628a\u63e1&#xff08;\u9875\u9762\u5207\u8d70\u65e9\u4e86\u5bb9\u6613\u5d29&#xff09;\u3001\u6bcf\u4e2a\u8bf7\u6c42\u90fd\u65b0\u5efa\u8fde\u63a5&#xff08;\u5217\u8868\u9875\u8fde\u62c9\u5341\u51e0\u4e2a\u63a5\u53e3\u65f6\u660e\u663e\u6162&#xff09;\u3002<\/p>\n<p>\u8fc1\u5230 RCP&#xff08;Remote Communication Kit&#xff09; \u4e4b\u540e&#xff1a;<\/p>\n<p>1. Session \u522b\u5230\u5904 new&#xff1a;\u6709\u540c\u4e8b\u5728\u6bcf\u4e2a\u9875\u9762\u90fd\u5efa Session&#xff0c;\u8fde\u63a5\u6839\u672c\u6ca1\u590d\u7528\u3002\u6b63\u786e\u505a\u6cd5\u662f\u5e94\u7528\u542f\u52a8\u65f6\u5efa\u4e00\u4e2a\u5168\u5c40\u5355\u4f8b&#xff1a;<\/p>\n<p><span class=\"token keyword\">import<\/span> <span class=\"token punctuation\">{<\/span> rcp <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">from<\/span> <span class=\"token string\">&#039;&#064;kit.RemoteCommunicationKit&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">const<\/span> sessionConfig<span class=\"token operator\">:<\/span> rcp<span class=\"token punctuation\">.<\/span>SessionConfiguration <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token comment\">\/\/ \u7528\u4e8e\u6307\u5b9a\u4e0e\u4f1a\u8bdd\u5173\u8054\u7684 HTTP \u8bf7\u6c42\u7684\u914d\u7f6e<\/span><br \/>\n  requestConfiguration<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    transfer<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token comment\">\/\/ \u8d85\u65f6\u65f6\u95f4\u53c2\u6570\u8bbe\u7f6e<\/span><br \/>\n      timeout<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        connectMs<span class=\"token operator\">:<\/span> <span class=\"token number\">5000<\/span><span class=\"token punctuation\">,<\/span>     <span class=\"token comment\">\/\/ \u8fde\u63a5\u8d85\u65f6&#xff0c;\u5355\u4f4d\u6beb\u79d2&#xff0c;\u9ed8\u8ba4\u503c 60000<\/span><br \/>\n        transferMs<span class=\"token operator\">:<\/span> <span class=\"token number\">10000<\/span>    <span class=\"token comment\">\/\/ \u4f20\u8f93\u8d85\u65f6&#xff0c;\u5355\u4f4d\u6beb\u79d2&#xff0c;\u9ed8\u8ba4\u503c 60000<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">const<\/span> session <span class=\"token operator\">&#061;<\/span> rcp<span class=\"token punctuation\">.<\/span><span class=\"token function\">createSession<\/span><span class=\"token punctuation\">(<\/span>sessionConfig<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>2. \u8d85\u65f6\u4e00\u5b9a\u8981\u81ea\u5df1\u914d&#xff1a;\u9ed8\u8ba4\u503c\u662f 60000 \u6beb\u79d2&#xff0c;\u4e5f\u5c31\u662f\u5f31\u7f51\u4e0b\u8981\u7b49\u6574\u6574\u4e00\u5206\u949f\u624d\u62a5\u9519&#xff0c;\u7528\u6237\u611f\u77e5\u5c31\u662f&#034;\u8f6c\u5708\u5708&#034;\u3002\u4e00\u822c\u8fde\u63a5 5 \u79d2\u3001\u4f20\u8f93 10 \u79d2\u591f\u7528\u3002<\/p>\n<p>3. \u81ea\u7b7e\u8bc1\u4e66\u63e1\u624b\u5931\u8d25&#xff1a;\u6d4b\u8bd5\u73af\u5883\u7528\u81ea\u7b7e\u8bc1\u4e66\u65f6&#xff0c;RCP \u9ed8\u8ba4\u6821\u9a8c\u76f4\u63a5\u5931\u8d25&#xff0c;\u5f00\u53d1\u671f\u53ef\u4ee5\u5728 security \u914d\u7f6e\u91cc\u4e34\u65f6\u8df3\u8fc7&#xff1a;<\/p>\n<p>security<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  remoteValidation<span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;skip&#039;<\/span><span class=\"token punctuation\">,<\/span>               <span class=\"token comment\">\/\/ \u5f00\u53d1\u671f\u4e34\u65f6\u7528&#xff1b;\u4e0a\u67b6\u524d\u5fc5\u987b\u6539\u56de\u7cfb\u7edf\u6821\u9a8c<\/span><br \/>\n  tlsOptions<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span> tlsVersion<span class=\"token operator\">:<\/span> <span class=\"token string\">&#039;TlsV1.2&#039;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u91cd\u8bd5\u5efa\u8bae&#xff1a;\u53ea\u5bf9\u5e42\u7b49\u8bf7\u6c42&#xff08;GET&#xff09;\u505a\u6307\u6570\u9000\u907f\u91cd\u8bd5&#xff0c;POST \u8c28\u614e&#xff08;\u53ef\u80fd\u91cd\u590d\u4e0b\u5355&#xff09;&#xff1b;\u9875\u9762\u9000\u51fa\u65f6\u53d6\u6d88\u672a\u5b8c\u6210\u8bf7\u6c42&#xff0c;\u5426\u5219\u5bb9\u6613\u5185\u5b58\u6cc4\u6f0f\u3002<\/p>\n<h3>\u7aef\u4e91\u8054\u8c03&#xff1a;\u7528\u4e00\u4e2a requestId \u628a\u4e24\u5934\u4e32\u8d77\u6765<\/h3>\n<p>\u8fd9\u662f\u6211\u89c9\u5f97\u6700\u503c\u5f97\u6c89\u6dc0\u7684\u4e00\u6761\u7ecf\u9a8c\u3002<\/p>\n<p>\u505a\u6cd5&#xff1a;App \u6bcf\u6b21\u8bf7\u6c42\u751f\u6210\u4e00\u4e2a requestId&#xff0c;\u653e\u8fdb\u8bf7\u6c42\u5934&#xff1b;\u670d\u52a1\u7aef Nginx \u548c API \u90fd\u628a\u5b83\u5199\u8fdb\u65e5\u5fd7&#xff1a;<\/p>\n<p># Nginx&#xff1a;\u628a\u7aef\u4e0a\u5e26\u6765\u7684 requestId \u8bb0\u5f55\u5230 access log<br \/>\nlog_format main &#039;$remote_addr &#8211; $request_time &#8211; &#034;$http_x_request_id&#034; &#039;<br \/>\n                &#039;&#034;$request&#034; $status&#039;;<\/p>\n<p>\u7aef\u4e0a\u6392\u969c\u65f6&#xff0c;\u4ece hilog \u62ff\u5230 requestId&#xff0c;\u76f4\u63a5\u53bb\u670d\u52a1\u7aef\u65e5\u5fd7\u91cc grep&#xff1a;<\/p>\n<p><span class=\"token function\">grep<\/span> <span class=\"token string\">&#039;a1b2c3d4&#039;<\/span> \/var\/log\/nginx\/access.log<\/p>\n<p>\u4e00\u6b21\u5b9a\u4f4d&#xff0c;\u4e0d\u7528\u518d\u9760\u65f6\u95f4\u6233\u731c\u3002 \u5f31\u7f51\u3001\u91cd\u8bd5\u3001\u8d85\u65f6\u8fd9\u7c7b\u95ee\u9898&#xff0c;\u6709\u6ca1\u6709 requestId \u5b8c\u5168\u662f\u4e24\u79cd\u6392\u969c\u6548\u7387\u3002<\/p>\n<p>\u6293\u5305\u63d0\u9192&#xff1a;\u771f\u673a\u6293 HTTPS \u9700\u8981\u88c5 CA \u8bc1\u4e66&#xff0c;\u800c\u4e0a\u9762\u63d0\u5230\u7684 trust-current-user-ca \u5173\u6389\u540e\u5c31\u6293\u4e0d\u5230\u660e\u6587\u4e86\u3002\u5224\u65ad\u4f9d\u636e&#xff1a;\u80fd\u6293\u5230 CONNECT \u4f46\u89e3\u4e0d\u51fa\u660e\u6587 &#061; CA \u6ca1\u88ab\u4fe1\u4efb&#xff0c;\u4e0d\u662f\u4ee3\u7406\u914d\u9519\u4e86\u3002<\/p>\n<h3>\u95ee\u9898\u901f\u67e5\u8868<\/h3>\n<table>\n<tr>\u73b0\u8c61\u5927\u6982\u7387\u539f\u56e0\u5904\u7406<\/tr>\n<tbody>\n<tr>\n<td>\u8bf7\u6c42\u76f4\u63a5\u5931\u8d25&#xff0c;\u670d\u52a1\u7aef\u65e0\u65e5\u5fd7<\/td>\n<td>\u672a\u58f0\u660e INTERNET \u6743\u9650<\/td>\n<td>\u52a0 requestPermissions<\/td>\n<\/tr>\n<tr>\n<td>\u53ea\u6709 http \u63a5\u53e3\u5931\u8d25<\/td>\n<td>\u660e\u6587\u6d41\u91cf\u88ab\u62e6<\/td>\n<td>\u914d network_config \u6216\u6539 https<\/td>\n<\/tr>\n<tr>\n<td>\u6539\u5b8c\u914d\u7f6e\u6ca1\u751f\u6548<\/td>\n<td>\u70ed\u91cd\u8f7d\u672a\u751f\u6548<\/td>\n<td>\u91cd\u65b0\u7f16\u8bd1\u6253\u5305<\/td>\n<\/tr>\n<tr>\n<td>\u6d4f\u89c8\u5668\u6b63\u5e38\u3001App SSL \u5931\u8d25<\/td>\n<td>\u4e2d\u95f4\u8bc1\u4e66\u7f3a\u5931<\/td>\n<td>\u914d fullchain \u5e76 reload<\/td>\n<\/tr>\n<tr>\n<td>\u5207 HTTPS \u540e\u5168\u7ebf\u6302<\/td>\n<td>\u8bc1\u4e66\u8fc7\u671f<\/td>\n<td>\u67e5\u6709\u6548\u671f&#xff0c;\u8865\u5230\u671f\u76d1\u63a7<\/td>\n<\/tr>\n<tr>\n<td>\u6293\u5305\u53ea\u89c1 CONNECT<\/td>\n<td>\u7528\u6237 CA \u672a\u4fe1\u4efb<\/td>\n<td>\u68c0\u67e5 trust-* \u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>\u5730\u94c1\/\u5f31\u7f51\u8f6c\u5708<\/td>\n<td>\u8d85\u65f6\u9ed8\u8ba4\u503c &#043; \u65e0\u9000\u907f\u91cd\u8bd5<\/td>\n<td>\u663e\u5f0f\u8bbe\u8d85\u65f6&#xff0c;GET \u505a\u6307\u6570\u9000\u907f<\/td>\n<\/tr>\n<tr>\n<td>\u9875\u9762\u9000\u51fa\u540e\u5076\u53d1\u5d29\u6e83<\/td>\n<td>\u8bf7\u6c42\u672a\u53d6\u6d88<\/td>\n<td>\u53d6\u6d88\u8bf7\u6c42 &#043; \u6302\u751f\u547d\u5468\u671f<\/td>\n<\/tr>\n<tr>\n<td>\u6392\u969c\u9760\u731c<\/td>\n<td>\u7aef\u4e91\u65e5\u5fd7\u65e0\u5173\u8054<\/td>\n<td>\u52a0 requestId \u8d2f\u7a7f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>FAQ<\/h3>\n<p>Q1&#xff1a;Previewer \u91cc\u80fd\u8c03\u7f51\u7edc\u63a5\u53e3\u5417&#xff1f;<br \/>\n\u4e0d\u80fd&#xff0c;Previewer \u4e0d\u63d0\u4f9b\u7f51\u7edc\u7b49\u7cfb\u7edf\u80fd\u529b\u3002\u6d89\u53ca\u7f51\u7edc\u7684\u8c03\u8bd5\u5fc5\u987b\u4e0a\u771f\u673a\u6216\u6a21\u62df\u5668\u3002<\/p>\n<p>Q2&#xff1a;\u4e00\u5b9a\u8981\u4e0a HTTPS \u5417&#xff1f;<br \/>\n\u6b63\u5f0f\u73af\u5883\u57fa\u672c\u662f\u786c\u6027\u8981\u6c42\u3002\u5373\u4fbf\u5e73\u53f0\u4e0d\u5f3a\u5236&#xff0c;\u660e\u6587\u4f20\u8f93 Token \u7684\u5b89\u5168\u98ce\u9669\u4e5f\u4e0d\u503c\u5f97\u5192\u3002<\/p>\n<p>Q3&#xff1a;\u8bc1\u4e66\u95ee\u9898\u600e\u4e48\u5b9a\u4f4d\u662f\u7aef\u8fd8\u662f\u670d\u52a1\u7aef&#xff1f;<br \/>\n\u6d4f\u89c8\u5668\u6b63\u5e38\u3001App \u5931\u8d25 \u2192 \u5927\u6982\u7387\u8bc1\u4e66\u94fe\u6216\u7cfb\u7edf\u4fe1\u4efb\u95ee\u9898&#xff1b;\u6d4f\u89c8\u5668\u4e5f\u5931\u8d25 \u2192 \u670d\u52a1\u7aef\u914d\u7f6e\u95ee\u9898\u3002\u518d\u914d\u5408 openssl s_client \u770b\u5b9e\u9645\u53d1\u51fa\u7684\u94fe\u3002<\/p>\n<p>Q4&#xff1a;Token \u8be5\u5b58\u5728\u54ea\u91cc&#xff1f;<br \/>\n\u522b\u7528 Preferences\u3002\u8d70\u7cfb\u7edf\u5b89\u5168\u80fd\u529b&#xff08;HUKS \u751f\u6210\u5bc6\u94a5 &#043; \u52a0\u5bc6\u5199\u5165 el2 \u76ee\u5f55&#xff0c;\u6216\u4f7f\u7528 Asset Store Kit&#xff09;\u3002\u4e1a\u52a1\u91cc\u53d6\u7528\u65f6\u518d\u89e3\u5bc6&#xff0c;\u4e0d\u8981\u5e38\u9a7b\u5168\u5c40\u72b6\u6001\u3002<\/p>\n<p>Q5&#xff1a;\u5237\u65b0 Token \u7684\u903b\u8f91\u653e\u54ea\u4e00\u5c42&#xff1f;<br \/>\n\u7edf\u4e00\u5728\u8bf7\u6c42\u62e6\u622a\u5668\u7684\u9519\u8bef\u56de\u8c03\u91cc\u5904\u7406&#xff0c;\u4e1a\u52a1\u9875\u9762\u4e0d\u611f\u77e5\u3002\u5237\u65b0\u6210\u529f\u91cd\u653e\u539f\u8bf7\u6c42&#xff0c;\u5237\u65b0\u5931\u8d25\u518d\u8df3\u767b\u5f55\u3002<\/p>\n<p>Q6&#xff1a;\u91cd\u8bd5\u4f1a\u4e0d\u4f1a\u9020\u6210\u91cd\u590d\u63d0\u4ea4&#xff1f;<br \/>\n\u4f1a\u3002\u6240\u4ee5\u53ea\u7ed9\u5e42\u7b49\u8bf7\u6c42\u52a0\u91cd\u8bd5&#xff1b;\u5199\u64cd\u4f5c\u8981\u4e48\u4e0d\u81ea\u52a8\u91cd\u8bd5&#xff0c;\u8981\u4e48\u5e26\u5e42\u7b49\u952e\u7531\u670d\u52a1\u7aef\u53bb\u91cd\u3002<\/p>\n<p>Q7&#xff1a;\u8001\u9879\u76ee\u8981\u4e0d\u8981\u4ece http \u8fc1\u5230 RCP&#xff1f;<br \/>\n\u65b0\u9879\u76ee\u76f4\u63a5\u7528 RCP\u3002\u8001\u9879\u76ee\u4e0d\u6025\u7684\u8bdd\u53ef\u4ee5\u6309\u6a21\u5757\u6162\u6162\u6362&#xff0c;\u6539\u52a8\u9762\u4e3b\u8981\u5728 Session \u5355\u4f8b\u6539\u9020\u548c\u8d85\u65f6\u53c2\u6570\u8fc1\u79fb\u4e24\u5757&#xff0c;\u98ce\u9669\u53ef\u63a7\u3002<\/p>\n<h3>\u5199\u5728\u6700\u540e<\/h3>\n<p>\u8fd9\u4e2a App \u4ece&#034;\u63a5\u53e3\u8c03\u4e0d\u901a&#034;\u5230\u7a33\u5b9a\u4e0a\u7ebf&#xff0c;\u771f\u6b63\u5361\u65f6\u95f4\u7684\u6280\u672f\u96be\u70b9\u4e0d\u5728 UI&#xff0c;\u800c\u5728\u7aef\u548c\u4e91\u4e4b\u95f4\u90a3\u6761\u94fe\u8def&#xff1a;\u7f51\u7edc\u6743\u9650\u3001\u660e\u6587\u7b56\u7565\u3001\u8bc1\u4e66\u94fe\u3001\u9274\u6743\u6ce8\u5165\u3001\u8d85\u65f6\u91cd\u8bd5\u3001\u65e5\u5fd7\u5173\u8054\u3002\u800c\u8fd9\u4e9b\u6070\u597d\u662f\u540e\u7aef\/\u8fd0\u7ef4\u89c6\u89d2\u7684\u5f3a\u9879\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4e5f\u5728\u505a\u9e3f\u8499\u9002\u914d&#xff0c;\u5efa\u8bae\u7b2c\u4e00\u5468\u5c31\u628a\u8fd9\u56db\u4ef6\u4e8b\u5b9a\u6b7b&#xff1a;\u7f51\u7edc\u5b89\u5168\u914d\u7f6e\u3001\u51ed\u636e\u5b58\u50a8\u65b9\u6848\u3001\u8bf7\u6c42\u5c42\u62e6\u622a\u5668\u5c01\u88c5\u3001requestId \u8d2f\u7a7f\u3002\u540e\u9762\u63a5\u591a\u5c11\u63a5\u53e3\u90fd\u4e0d\u4f1a\u4e71\u3002<\/p>\n<p>\u611f\u5174\u8da3\u53ef\u4ee5\u5173\u6ce8\u4e00\u4e0b&#xff0c;\u6211\u4eec\u4e0b\u671f\u89c1\u3002<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55&#xff1a;HarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API&#xff0c;\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39\u514d\u8d23\u58f0\u660e&#xff1a;\u672c\u6587\u4e3a\u4e2a\u4eba\u5f00\u53d1\u7b14\u8bb0&#xff0c;\u73af\u5883\u4e3a HarmonyOS 7.x&#xff08;API 26&#xff09;\/ DevEco Studio 5.x&#xff0c;\u540e\u7aef\u4e3a Nginx  \u81ea\u5efa API\u3002\u4e0d\u540c API \u7248\u672c\u884c\u4e3a\u53ef\u80fd\u6709\u5dee\u5f02&#xff0c;\u8bf7\u4ee5\u5b98\u65b9\u6587\u6863\u4e3a\u51c6\u3002\u8d77\u56e0&#xff1a;\u672c\u5730\u80fd\u8dd1&#xff0c;\u771f\u673a\u767d\u5c4f<br \/>\nAp<\/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":[12392,280,67,1737],"topic":[],"class_list":["post-122505","post","type-post","status-publish","format-standard","hentry","category-server","tag-12392","tag-harmonyos","tag-67","tag-1737"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39 - \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\/122505.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55&#xff1a;HarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API&#xff0c;\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39\u514d\u8d23\u58f0\u660e&#xff1a;\u672c\u6587\u4e3a\u4e2a\u4eba\u5f00\u53d1\u7b14\u8bb0&#xff0c;\u73af\u5883\u4e3a HarmonyOS 7.x&#xff08;API 26&#xff09;\/ DevEco Studio 5.x&#xff0c;\u540e\u7aef\u4e3a Nginx \u81ea\u5efa API\u3002\u4e0d\u540c API \u7248\u672c\u884c\u4e3a\u53ef\u80fd\u6709\u5dee\u5f02&#xff0c;\u8bf7\u4ee5\u5b98\u65b9\u6587\u6863\u4e3a\u51c6\u3002\u8d77\u56e0&#xff1a;\u672c\u5730\u80fd\u8dd1&#xff0c;\u771f\u673a\u767d\u5c4f Ap\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/122505.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-04T17:16:50+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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/122505.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/122505.html\",\"name\":\"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-04T17:16:50+00:00\",\"dateModified\":\"2026-11-04T17:16:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/122505.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/122505.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/122505.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39\"}]},{\"@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\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39 - \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\/122505.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55&#xff1a;HarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API&#xff0c;\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39\u514d\u8d23\u58f0\u660e&#xff1a;\u672c\u6587\u4e3a\u4e2a\u4eba\u5f00\u53d1\u7b14\u8bb0&#xff0c;\u73af\u5883\u4e3a HarmonyOS 7.x&#xff08;API 26&#xff09;\/ DevEco Studio 5.x&#xff0c;\u540e\u7aef\u4e3a Nginx \u81ea\u5efa API\u3002\u4e0d\u540c API \u7248\u672c\u884c\u4e3a\u53ef\u80fd\u6709\u5dee\u5f02&#xff0c;\u8bf7\u4ee5\u5b98\u65b9\u6587\u6863\u4e3a\u51c6\u3002\u8d77\u56e0&#xff1a;\u672c\u5730\u80fd\u8dd1&#xff0c;\u771f\u673a\u767d\u5c4f Ap","og_url":"https:\/\/www.wsisp.com\/helps\/122505.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-04T17:16:50+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/122505.html","url":"https:\/\/www.wsisp.com\/helps\/122505.html","name":"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-04T17:16:50+00:00","dateModified":"2026-11-04T17:16:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/122505.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/122505.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/122505.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u9e3f\u8499\u5fc3\u8ff9\u3011\u7aef\u4e91\u534f\u540c\u8e29\u5751\u5f55\uff1aHarmonyOS 7 \u5e94\u7528\u8c03\u540e\u7aef API\uff0c\u6211\u5728\u8bc1\u4e66\u3001\u9274\u6743\u3001\u5f31\u7f51\u4e0a\u4ea4\u7684\u5b66\u8d39"}]},{"@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\/122505","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=122505"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/122505\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=122505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=122505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=122505"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=122505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}