{"id":229804,"date":"2020-12-17T20:49:38","date_gmt":"2020-12-17T12:49:38","guid":{"rendered":"http:\/\/4563.org\/?p=229804"},"modified":"2020-12-17T20:49:38","modified_gmt":"2020-12-17T12:49:38","slug":"%e6%9c%89%e4%ba%ba%e4%bd%bf%e7%94%a8%e5%b0%8f%e7%a8%8b%e5%ba%8f%e7%9a%84%e4%ba%91%e5%bc%80%e5%8f%91%e9%81%87%e5%88%b0%e8%bf%87%e8%bf%99%e4%b8%aa%e6%8a%a5%e9%94%99%e5%90%97%ef%bc%9f-cloud-function-serv","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=229804","title":{"rendered":"\u6709\u4eba\u4f7f\u7528\u5c0f\u7a0b\u5e8f\u7684\u4e91\u5f00\u53d1\u9047\u5230\u8fc7\u8fd9\u4e2a\u62a5\u9519\u5417\uff1f cloud function service error code -501000, error message Environment not found"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709\u4eba\u4f7f\u7528\u5c0f\u7a0b\u5e8f\u7684\u4e91\u5f00\u53d1\u9047\u5230\u8fc7\u8fd9\u4e2a\u62a5\u9519\u5417\uff1f cloud function service error code -501000, error message Environment not found               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : labulaka521 <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e91\u51fd\u6570\u5df2\u7ecf\u4e0a\u4f20\u4e86\uff0c\u4e91\u7aef\u6d4b\u8bd5\u4e5f\u662f\u6b63\u5e38\u7684<\/p>\n<pre><code>const cloud = require('wx-server-sdk')  \/\/ \u521d\u59cb\u5316 cloud cloud.init({   \/\/ API \u8c03\u7528\u90fd\u4fdd\u6301\u548c\u4e91\u51fd\u6570\u5f53\u524d\u6240\u5728\u73af\u5883\u4e00\u81f4   env: cloud.DYNAMIC_CURRENT_ENV })  \/**  * \u8fd9\u4e2a\u793a\u4f8b\u5c06\u7ecf\u81ea\u52a8\u9274\u6743\u8fc7\u7684\u5c0f\u7a0b\u5e8f\u7528\u6237 openid \u8fd4\u56de\u7ed9\u5c0f\u7a0b\u5e8f\u7aef  *  * event \u53c2\u6570\u5305\u542b\u5c0f\u7a0b\u5e8f\u7aef\u8c03\u7528\u4f20\u5165\u7684 data  *  *\/ exports.main = async (event, context) =&gt; {   console.log(context) }  <\/code><\/pre>\n<p>\u5b8c\u6574\u62a5\u9519<\/p>\n<pre><code>Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID , cloud function service error code -501000, error message Environment not found; at cloud.callFunction api;  <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4713448\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xiaTianChiXiGua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             error message Environment not found \u8fd9\u4e0d\u662f\u5199\u4e86\u9519\u8bef\u63d0\u793a\u4e86\u4e48\uff0c\u4f60\u628a env: cloud.DYNAMIC_CURRENT_ENV \u8fd9\u4e2a\u6539\u6210 env:&#8217;\u4f60\u7684\u73af\u5883 id&#8217;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4713449\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : bbsabc2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e91\u5185\u5bb9\u5220\u6389\uff0c\u6574\u4f53\u91cd\u65b0\u4e0a\u4f20\u4e00\u904d\u5c31\u597d\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4713450\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : labulaka521 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @bbsabc2 \u662f\u628a\u4e91\u51fd\u6570\u5220\u6389\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4713451\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : labulaka521 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @bbsabc2 \u8fd9\u4e2a\u51fd\u6570\u6211\u5f00\u542f\u672c\u5730\u8c03\u8bd5\u5c31\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\uff0c\u7136\u540e\u5173\u95ed\u540e\u5c31\u8bbf\u95ee\u4e0d\u4e86\u4e86\uff0c\u670d\u4e86\uff0c\u6709\u6bd2                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4713452\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : labulaka521 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xiaTianChiXiGua <br \/>@bbsabc2 <br \/>\u8c22\u8c22 \u7ec8\u4e8e\u627e\u5230\u95ee\u9898\u4e86 \u6211\u6362\u4e86\u5c0f\u7a0b\u5e8f \u4f46\u662f\u6ca1\u6362 env \u7684\u73af\u5883 id \u81ea\u5df2\u597d\u8822                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u4eba\u4f7f\u7528\u5c0f\u7a0b\u5e8f\u7684\u4e91\u5f00\u53d1\u9047\u5230\u8fc7\u8fd9\u4e2a\u62a5&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/229804"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=229804"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/229804\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229804"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}