You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
PHTML
43 lines
1.1 KiB
PHTML
1 year ago
|
<?php
|
||
|
send();
|
||
|
function send() {
|
||
|
$url = 'http://cl3-uc01gh.huanyuantech.com/acf/send_gift.php';
|
||
|
$data = [
|
||
|
'appId' => 'chengfeng',
|
||
|
'userId' => 5141, // ljl654321
|
||
|
'orderNum' => time() . rand(1000, 9999),
|
||
|
'title' => '测试邮件',
|
||
|
'content' => '测试礼包发送',
|
||
|
'packages' => json_encode([
|
||
|
[
|
||
|
'packageId' => '29044',
|
||
|
'count' => 10,
|
||
|
],
|
||
|
|
||
|
]),
|
||
|
'serverId' => 1,
|
||
|
'roleId' => 65740,
|
||
|
'time' => time(),
|
||
|
];
|
||
|
$data['sign'] = sign($data);
|
||
|
var_dump($data);
|
||
|
$ch = curl_init ();
|
||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||
|
$response = curl_exec ($ch);
|
||
|
curl_close($ch);
|
||
|
var_dump($response);
|
||
|
}
|
||
|
|
||
|
function sign($params) {
|
||
|
unset($params['sign']);
|
||
|
ksort($params);
|
||
|
$signString = '';
|
||
|
foreach ($params as $key => $value) {
|
||
|
$signString .= $value;
|
||
|
}
|
||
|
return md5($signString . 'a3f579b5add2342a7ac07017b7650c45');
|
||
|
}
|