diff --git a/app/admin/controller/Wxserve.php b/app/admin/controller/Wxserve.php index aef60b54..c33caf8e 100644 --- a/app/admin/controller/Wxserve.php +++ b/app/admin/controller/Wxserve.php @@ -154,7 +154,7 @@ class Wxserve extends Controller $obj = new Server(); $res = $obj->commit($appid, $template_id); if ($res) { - return $this->renderSuccess('success'); + return $this->renderSuccess([$res]); } } return $this->renderError('操作失败'); diff --git a/app/common/library/wxserver/Server.php b/app/common/library/wxserver/Server.php index 0ec397f6..e050dfef 100644 --- a/app/common/library/wxserver/Server.php +++ b/app/common/library/wxserver/Server.php @@ -168,11 +168,13 @@ class Server $url = 'https://api.weixin.qq.com/wxa/commit?access_token=' . $access_token; $result = $this->curlPost($url, json_encode($data)); $result = json_decode($result, true); + return $result; if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { $model->update(['version' => $version . $desc], ['id' => $info['id']]); return true; } } + return false; } /**