From 36df14a3b82621e479a135325062cebae1581f2c Mon Sep 17 00:00:00 2001 From: liapples Date: Sun, 12 Dec 2021 17:36:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=B8=8A=E4=BC=A0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=94=BE=E5=9C=A8=E9=85=8D=E7=BD=AE=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E4=BF=9D=E6=8A=A4=E6=8C=87=E5=BC=95=E4=B9=8B?= =?UTF-8?q?=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/UploadMiniProgram.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Service/UploadMiniProgram.php b/app/Service/UploadMiniProgram.php index 5a9ccab..06dc0fd 100644 --- a/app/Service/UploadMiniProgram.php +++ b/app/Service/UploadMiniProgram.php @@ -46,7 +46,15 @@ class UploadMiniProgram $version = $template->user_version; $description = $agent->company_name; + //提交上传 + $commit = $code->commit($templateId, $extJson, $version, $description); + + if (!isset($commit['errcode'], $commit['errmsg']) || $commit['errcode'] != 0 || $commit['errmsg'] != 'ok') { + throw new Exception($commit['errmsg'] ?? join(',', $commit)); + } + //配置小程序用户隐私保护指引:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/set_privacy_setting.html + //说明文档:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/product/privacy_setting.html //配置后,需重新提交代码审核,审核通过且需要重新发布上线后才会在小程序端生效。 $redis_key = 'mini_program_set_privacy'; if (!Redis::hget($redis_key, $agent->appid)) { @@ -77,13 +85,6 @@ class UploadMiniProgram Redis::hset($redis_key, $agent->appid, 1); } - //提交上传 - $commit = $code->commit($templateId, $extJson, $version, $description); - - if (!isset($commit['errcode'], $commit['errmsg']) || $commit['errcode'] != 0 || $commit['errmsg'] != 'ok') { - throw new Exception($commit['errmsg'] ?? join(',', $commit)); - } - //提交审核,文档:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/code/submit_audit.html $res = $code->submitAudit([]);