'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'); }