$aSinge, // 'aTagNames' => $aTagsName, // 'sMenu' => 'client', ]); } public function imageUploadExec() { if ($_SERVER['REQUEST_METHOD'] == 'POST') { // 检查文件是否上传成功 if (isset($_FILES['files']) && $_FILES['files']['error'][0] == 0) { $uploadFileDir = './upload/'; foreach ($_FILES['files']['tmp_name'] as $key => $tmpName) { $fileName = $_FILES['files']['name'][$key]; $fileError = $_FILES['files']['error'][$key]; // 检查文件上传是否有错误 if ($fileError == 0) { $dest_path = $uploadFileDir . $fileName; // 移动文件到目标目录 if (move_uploaded_file($tmpName, $dest_path)) { echo '文件上传成功: ' . $dest_path . '
'; } else { echo '文件上传失败: ' . $fileName . '
'; } } else { echo '文件上传错误: ' . $fileName . '
'; } } } else { echo '没有文件上传或发生错误。'; } } } public function imageUpload() { return view("cmd/image/upload"); } public function ajaxSend() { $sSite = $_POST["site"]; $sValue = $_POST["value"]; $sHook = $_POST["hook"]; $sArea = $_POST["area"]; $sUser = $_POST["user"]; $sEnterType = $_POST["enterType"]; if ($sHook) { $sValue = $sHook.$sValue; } if ($sEnterType == "area") { $sValue = trim($sValue)." ".$sArea; } $aDoveSiteMap = ModelDoveSite::_getMap(); $sUrl = isset($aDoveSiteMap[$sSite]) ? $aDoveSiteMap[$sSite] : false; if (!$sUrl) { return "没有这个dove"; } $sUrl = "https://".$sUrl; $aData = [ "shell" => "cmd", 'update_id' => 123456789, 'message' => [ 'message_id' => 1, 'from' => [ 'id' => 7740568271, 'is_bot' => false, 'first_name' => $sUser, 'last_name' => 'Doe', 'username' => 'johndoe', 'language_code' => 'en' ], 'chat' => [ 'id' => -4668400285, 'first_name' => 'John', 'last_name' => 'Doe', 'username' => 'johndoe', 'type' => 'private' ], 'date' => 1610000000, "text" => $sValue, ] ]; // $data = ['key1' => 'value1', 'key2' => 'value2']; // $options = [ // 'http' => [ // 'method' => 'POST', // 'header' => "Content-Type: application/json\r\n", // 'content' => json_encode($aData) // ] // ]; // // $options['ssl'] = [ // 'verify_peer' => false, // 'verify_peer_name' => false // ]; // // $context = stream_context_create($options); // $response = file_get_contents($url, false, $context); // // // // //// echo "
";
////        echo($response);
////        echo nl2br($response);
//        echo $response;
//        exit;
//        
//        
//        
//        
//        
//        
//        
//        
//        
//        
//        
//        
//        
//        exit;
        
        $oHttp = new Http();
        $oHttp->sMethod = "post";
        $oHttp->sToUrl = $sUrl;
        $oHttp->bIsJson = true;
        $oHttp->aData = $aData;
//        $oHttp->aData = [
//            'update_id' => 123456789,
//            'message' => [
//                'message_id' => 1,
//                'from' => [
//                    'id' => 7740568271,
//                    'is_bot' => false,
//                    'first_name' => 'John',
//                    'last_name' => 'Doe',
//                    'username' => 'johndoe',
//                    'language_code' => 'en'
//                ],
//                'chat' => [
//                    'id' => -4668400285,
//                    'first_name' => 'John',
//                    'last_name' => 'Doe',
//                    'username' => 'johndoe',
//                    'type' => 'private'
//                ],
//                'date' => 1610000000,
//                "text" => $sValue,
//            ]
//        ];

        $r = $oHttp->send();

//        echo "
";
//        echo($r);
        echo $r;

        exit;
    }
    
}