wang hou sheng 10 months ago
parent d0b94e43e8
commit b13c8aaac8
  1. 2
      app/admin/controller/Wxserve.php
  2. 3
      app/common/library/wxserver/Server.php

@ -166,7 +166,7 @@ class Wxserve extends Controller
$obj = new Server(); $obj = new Server();
$res = $obj->commit($appid, $template_id); $res = $obj->commit($appid, $template_id);
if ($res) { if ($res) {
return $this->renderSuccess('success'); return $this->renderSuccess($res);
} }
} }
return $this->renderError('操作失败'); return $this->renderError('操作失败');

@ -176,7 +176,7 @@ class Server
* @throws BaseException * @throws BaseException
* @author: wanghousheng * @author: wanghousheng
*/ */
public function commit($appid, $template_id): bool public function commit($appid, $template_id)
{ {
$version = ''; $version = '';
$access_token = $this->authorizerAccessToken($appid); $access_token = $this->authorizerAccessToken($appid);
@ -204,6 +204,7 @@ class Server
$url = 'https://api.weixin.qq.com/wxa/commit?access_token=' . $access_token; $url = 'https://api.weixin.qq.com/wxa/commit?access_token=' . $access_token;
$result = $this->curlPost($url, json_encode($data)); $result = $this->curlPost($url, json_encode($data));
$result = json_decode($result, true); $result = json_decode($result, true);
return $result;
if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') {
//体验码 //体验码
$qr_code = $this->getQrcode($appid); $qr_code = $this->getQrcode($appid);

Loading…
Cancel
Save