From c49f8b955d751f27e65925527f220e40423044bc Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 25 Nov 2024 19:23:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=AE=A1=E6=A0=B8=E8=AF=B7?= =?UTF-8?q?=E6=B1=82API=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/distribution/Apply.php | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/admin/controller/distribution/Apply.php b/app/admin/controller/distribution/Apply.php index a8904282..87088879 100755 --- a/app/admin/controller/distribution/Apply.php +++ b/app/admin/controller/distribution/Apply.php @@ -45,6 +45,15 @@ class Apply extends AdminBase { if ($this->request->isAjax()) { $post = $this->request->post(); + + $result = $this->requestCompleteAudit($post['id']); + if ($result) { + if ($result['code'] == 0) { + return JsonServer::error($result['msg']); + } + } else { + return JsonServer::error('解析失败'); + } $res = ApplyLogic::audit($post); if ($res === false) { $message = ApplyLogic::getError() ?: '审核失败'; @@ -55,4 +64,19 @@ class Apply extends AdminBase return view(); } + + private function requestCompleteAudit($id) + { + try { + $url = request()->domain() . '/api/gh/CompleteAudit?id=' . $id; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + $response = curl_exec($ch); + curl_close($ch); + return json_decode($response, true); + } catch (\Exception $e) { + return false; + } + } } \ No newline at end of file