{"id":1999,"date":"2023-04-01T11:31:29","date_gmt":"2023-04-01T03:31:29","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1999"},"modified":"2023-04-07T20:05:32","modified_gmt":"2023-04-07T12:05:32","slug":"precautions-for-using-alipay-applet-network-api","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/04\/01\/precautions-for-using-alipay-applet-network-api\/","title":{"rendered":"\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u7f51\u7edc API \u4f7f\u7528\u6ce8\u610f\u4e8b\u9879"},"content":{"rendered":"<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/opendocs.alipay.com\/mini\/008gq6\">https:\/\/opendocs.alipay.com\/mini\/008gq6<\/a><\/p>\n<h2>\u670d\u52a1\u5668\u57df\u540d\u767d\u540d\u5355<\/h2>\n<p>\u670d\u52a1\u5668\u57df\u540d\u767d\u540d\u5355\u662f\u4e3a\u4e86\u4fdd\u8bc1\u7528\u6237\u5b89\u5168\uff0c\u6240\u505a\u7684\u9650\u5236\u6027\u63aa\u65bd\uff0c\u4f7f\u7528\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p><!-- more --><\/p>\n<ul>\n<li>\u8bf7\u9884\u5148\u5728 <strong><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/open.alipay.com\/mini\/dev\/list\" title=\"\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u7ba1\u7406\u4e2d\u5fc3\">\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u7ba1\u7406\u4e2d\u5fc3<\/a><\/strong> &gt; <strong>\u5c0f\u7a0b\u5e8f\u8be6\u60c5<\/strong> &gt; <strong>\u8bbe\u7f6e<\/strong> &gt; <strong>\u5f00\u53d1\u8bbe\u7f6e<\/strong> &gt; <strong>\u670d\u52a1\u5668\u57df\u540d\u767d\u540d\u5355<\/strong> \u4e2d\u914d\u7f6e\u57df\u540d\u767d\u540d\u5355\u3002\u5c0f\u7a0b\u5e8f\u5728\u4ee5\u4e0b API \u8c03\u7528\u65f6\u53ea\u80fd\u4e0e\u767d\u540d\u5355\u4e2d\u7684\u57df\u540d\u8fdb\u884c\u901a\u8baf\uff1aHTTP \u8bf7\u6c42\uff08<code>my.request<\/code>\uff09\u3001\u4e0a\u4f20\u6587\u4ef6\uff08<code>my.uploadFile<\/code>\uff09\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"http:\/\/mdn.alipayobjects.com\/afts\/img\/A*xM4NR6VRbfzGJmFFrCUnsgBkAa8wAA\/original?bz=openpt_doc&amp;t=LaBryvibyj5g0SshaLeFcwAAAABkMK8AAAAA\" alt=\"\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u57df\u540d\u767d\u540d\u5355\u914d\u7f6e\" \/><\/p>\n<p><strong>\u6dfb\u52a0\u670d\u52a1\u5668\u57df\u540d\u767d\u540d\u5355\u540e\uff0c\u9700\u8981\u91cd\u65b0\u6253\u5305\u4e0a\u4f20\u751f\u6210\u4f53\u9a8c\u7248\uff0c\u670d\u52a1\u5668\u57df\u540d\u624d\u4f1a\u751f\u6548<\/strong><\/p>\n<p><strong>\u82e5\u4ecd\u7136\u62a5\u9519\uff1a\u65e0\u6743\u8c03\u7528\u8be5\u63a5\u53e3\uff0c\u5219\u53ef\u5220\u6389\u57df\u540d\u91cd\u65b0\u914d\u7f6e<\/strong><\/p>\n<ul>\n<li>\u670d\u52a1\u5668\u57df\u540d\u767d\u540d\u5355\u662f\u4ee5\u4e00\u7ea7\u57df\u540d\u8fdb\u884c\u5339\u914d\u7684\u3002<\/li>\n<\/ul>\n<pre><code>\u5047\u5982\u5546\u6237\u6709 a.com \u548c b.com \u4e24\u4e2a\u57df\u540d\uff0c\u4e1a\u52a1\u5206\u522b\u90e8\u7f72\u5728\n1.a.com\n2.a.com\n1.b.com\n2.b.com\n3.b.com\n\u90a3\u4e48\uff0c\u5728\u670d\u52a1\u5668\u57df\u540d\u767d\u540d\u5355\u91cc\u9762\u53ea\u9700\u8981\u914d\u7f6e a.com \u548c b.com \u5373\u53ef\uff0c\u8fd9\u91cc\u662f\u4e00\u7ea7\u57df\u540d\u5339\u914d\u3002<\/code><\/pre>\n<h2>\u8df3\u8fc7\u57df\u540d\u68c0\u9a8c<\/h2>\n<p>\u82e5\u5728 IDE \u4e2d\u8fdb\u884c\u6d4b\u8bd5\uff0c\u8bf7\u8bbe\u7f6e<strong>\u5ffd\u7565 httpRequest \u57df\u540d\u5408\u6cd5\u6027\u68c0\u67e5<\/strong>\u3002IDE \u4e2d\u8c03\u8bd5\u4e0d\u53d7\u670d\u52a1\u5668\u57df\u540d\u767d\u540d\u5355\u5f71\u54cd\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/mdn.alipayobjects.com\/afts\/img\/A*bCm2Rab9iv0AAAAAAAAAAABkAa8wAA\/1024w_1024h_1l.png?bz=openpt_doc&amp;t=28pazEeCtzJiny7uCnkjUQAAAABkMK8AAAAA\" alt=\"\u5ffd\u7565 httpRequest \u57df\u540d\u5408\u6cd5\u6027\u68c0\u67e5\" \/><\/p>\n<h2>\u7f51\u7edc\u8bf7\u6c42<\/h2>\n<ul>\n<li>\u9ed8\u8ba4\u8d85\u65f6\u65f6\u95f4\u4e3a 30000 ms<\/li>\n<li>\u5c0f\u7a0b\u5e8f\u4f1a\u81ea\u5e26 HTTP Referer\uff0c\u6682\u65f6\u4e0d\u652f\u6301\u81ea\u5b9a\u4e49\u8bbe\u7f6e HTTP Referer<\/li>\n<li>\u53ea\u8981\u6210\u529f\u63a5\u6536\u5230\u670d\u52a1\u5668\u8fd4\u56de\uff0c\u65e0\u8bba status \u662f\u591a\u5c11\uff0c\u90fd\u4f1a\u8fdb\u5165 success \u56de\u8c03\u51fd\u6570\u3002\u8bf7\u5f00\u53d1\u8005\u6839\u636e\u4e1a\u52a1\u903b\u8f91\u5bf9\u8fd4\u56de\u503c\u8fdb\u884c\u5224\u65ad<\/li>\n<\/ul>\n<h2>HTTPS \u8bc1\u4e66<\/h2>\n<p>\u5c0f\u7a0b\u5e8f\u5fc5\u987b\u4f7f\u7528 HTTPS\/WSS \u53d1\u8d77\u7f51\u7edc\u8bf7\u6c42\u3002\u8bf7\u6c42\u65f6\u7cfb\u7edf\u4f1a\u5bf9\u670d\u52a1\u5668\u57df\u540d\u4f7f\u7528\u7684 HTTPS \u8bc1\u4e66\u8fdb\u884c\u6821\u9a8c\uff0c\u5982\u679c\u6821\u9a8c\u5931\u8d25\uff0c\u5219\u8bf7\u6c42\u4e0d\u80fd\u6210\u529f\u53d1\u8d77\u3002\u7531\u4e8e\u7cfb\u7edf\u9650\u5236\uff0c\u4e0d\u540c\u5e73\u53f0\u5bf9\u4e8e\u8bc1\u4e66\u8981\u6c42\u7684\u4e25\u683c\u7a0b\u5ea6\u4e0d\u540c\u3002\u4e3a\u4e86\u4fdd\u8bc1\u5c0f\u7a0b\u5e8f\u7684\u517c\u5bb9\u6027\uff0c\u5efa\u8bae\u5f00\u53d1\u8005\u6309\u7167\u6700\u9ad8\u6807\u51c6\u8fdb\u884c\u8bc1\u4e66\u914d\u7f6e\uff0c\u5e76\u4f7f\u7528\u76f8\u5173\u5de5\u5177\u68c0\u67e5\u73b0\u6709\u8bc1\u4e66\u662f\u5426\u7b26\u5408\u8981\u6c42\u3002<\/p>\n<p>\u5c0f\u7a0b\u5e8f\u53ea\u652f\u6301 HTTPS \u57df\u540d\u914d\u7f6e\u3002 \u76f8\u6bd4\u4e8e HTTP\uff0cHTTPS \u53ef\u4ee5\u63d0\u4f9b\u66f4\u52a0\u4f18\u8d28\u4fdd\u5bc6\u7684\u4fe1\u606f\uff0c\u4fdd\u8bc1\u4e86\u7528\u6237\u6570\u636e\u7684\u5b89\u5168\u6027\uff0c\u6b64\u5916 HTTPS \u540c\u65f6\u4e5f\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u4fdd\u62a4\u4e86\u670d\u52a1\u7aef\uff0c\u4f7f\u7528\u6076\u610f\u653b\u51fb\u548c\u4f2a\u88c5\u6570\u636e\u7684\u6210\u672c\u5927\u5927\u63d0\u9ad8\u3002<\/p>\n<p>\u56e0\u6b64\u5c0f\u7a0b\u5e8f\u5f3a\u5236\u4f7f\u7528 HTTPS\uff0c\u8fd8\u5728\u4f7f\u7528 HTTP \u534f\u8bae\u7684\u5f00\u53d1\u8005\u9700\u8981\u5c3d\u5feb\u5bf9\u670d\u52a1\u5668\u8fdb\u884c\u5347\u7ea7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\uff1ahttps:\/\/opendocs.alipay.com\/mini\/008gq6 \u670d\u52a1\u5668\u57df\u540d\u767d\u540d\u5355 \u670d\u52a1\u5668 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[372],"tags":[],"class_list":["post-1999","post","type-post","status-publish","format-standard","hentry","category-alipay"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1999"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1999\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}