fixed
This commit is contained in:
58
admin/application/api/controller/Test.php
Normal file
58
admin/application/api/controller/Test.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/*
|
||||
* description:
|
||||
* author:wh
|
||||
* email:
|
||||
* createTime:{2025/3/29} {13:46}
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\api\logic\PyappLofic;
|
||||
use think\Controller;
|
||||
|
||||
class Test extends Controller
|
||||
{
|
||||
|
||||
function test(){
|
||||
|
||||
$obj = new PyappLofic();
|
||||
$res = $obj->setFollowupModel('54116019493@chatroom','测试内容');
|
||||
|
||||
|
||||
dump($res);die;
|
||||
|
||||
$url = 'https://wechat-api-test.excn.vip/vip_groups/follow-up';
|
||||
$data = [
|
||||
"chatroom_id" => "54116019493@chatroom",
|
||||
"is_follow_up" => true,
|
||||
"follow_up_content" => "测试回访内容"
|
||||
];
|
||||
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE );
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE );
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'accept: application/json',
|
||||
'Content-Type: application/json'
|
||||
]);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
if (curl_errno($ch)) {
|
||||
echo 'Error:' . curl_error($ch);
|
||||
} else {
|
||||
echo 'Response:' . $response;
|
||||
echo 'HTTP Code:' . $httpCode;
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user