确认审核请求API接口

This commit is contained in:
wangxiaowei 2024-11-25 19:23:49 +08:00
parent 6f3c847531
commit c49f8b955d

@ -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;
}
}
}