From 949114260101fc51c49b1b13597c073ae93fbb0d Mon Sep 17 00:00:00 2001 From: 王智 <wz@bronet.cn> Date: Tue, 16 Mar 2021 13:20:56 +0800 Subject: [PATCH] 文档修改 --- application/common/controller/Api.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/application/common/controller/Api.php b/application/common/controller/Api.php index c6a0664..b7eb055 100644 --- a/application/common/controller/Api.php +++ b/application/common/controller/Api.php @@ -638,25 +638,27 @@ class Api public function UserInserMiniAppQrCode($UserId, $Path) { //小程序码 - $options = [ - 'app_id' => appid, - 'secret' => secret, - ]; - $app = new Application($options); - // 获取 access token 实例 - $accessToken = $app->access_token; - $AccessToken = $accessToken->getToken(); - $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' . $AccessToken; - $Json = [ - 'scene' => 'Goods_id=0&User_id=' . $UserId, - 'path' => $Path, -// 'is_hyaline' => True - ]; - $MiniAppQrcodeVendor = $this->curlPost1($url, $Json); - $JsonDecode = json_decode($MiniAppQrcodeVendor, true); +// $options = [ +// 'app_id' => appid, +// 'secret' => secret, +// ]; +// $app = new Application($options); +// // 获取 access token 实例 +// $accessToken = $app->access_token; +// $AccessToken = $accessToken->getToken(); +// $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' . $AccessToken; +// $Json = [ +// 'scene' => 'Goods_id=0&User_id=' . $UserId, +// 'path' => $Path, +//// 'is_hyaline' => True +// ]; +// $MiniAppQrcodeVendor = $this->curlPost1($url, $Json); +// $JsonDecode = json_decode($MiniAppQrcodeVendor, true); + $JsonDecode = json_decode('{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest rid: 604f8b86-35e79e71-2a52ba2d"}', true); if ($JsonDecode['errcode'] && $JsonDecode['errcode'] == 40001) { $this->error('网咯拥堵'); } + return 1; $PayOrder = $this->PayOrder(); $path = './MiniAppQrCode/' . $UserId . '.png'; $res = file_put_contents($path, $MiniAppQrcodeVendor);//将微信返回的图片数据流写入文件 -- libgit2 0.24.0