Browse Source

提交上传代码放在配置用户隐私保护指引之后

master
李可松 4 years ago
parent
commit
36df14a3b8
  1. 15
      app/Service/UploadMiniProgram.php

15
app/Service/UploadMiniProgram.php

@ -46,7 +46,15 @@ class UploadMiniProgram
$version = $template->user_version; $version = $template->user_version;
$description = $agent->company_name; $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/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'; $redis_key = 'mini_program_set_privacy';
if (!Redis::hget($redis_key, $agent->appid)) { if (!Redis::hget($redis_key, $agent->appid)) {
@ -77,13 +85,6 @@ class UploadMiniProgram
Redis::hset($redis_key, $agent->appid, 1); 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 //提交审核,文档:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/code/submit_audit.html
$res = $code->submitAudit([]); $res = $code->submitAudit([]);

Loading…
Cancel
Save