Open mcy2016 opened 4 years ago
public function jobMsg(Request $request) { $params = $request->post(); $mcy_ding = new McyDing($this->_config); // $access_token = $mcy_ding->access_token->get(); $data = [ "agent_id"=> "626044106", "userid_list"=>$params['ding_userid'], "msg" =>[ "msgtype"=>'markdown', "markdown"=>[ "title"=>$params['title'].'接机工作任务', "text"=>$params['text'] ] ] ]; $result = $mcy_ding->conversation->sendCorporationMessage($data); return $result; } 已经传msg了,总是提示Missing required arguments:msg
public function jobMsg(Request $request) { $params = $request->post(); $mcy_ding = new McyDing($this->_config); // $access_token = $mcy_ding->access_token->get(); $data = [ "agent_id"=> "626044106", "userid_list"=>$params['ding_userid'], "msg" =>[ "msgtype"=>'markdown', "markdown"=>[ "title"=>$params['title'].'接机工作任务', "text"=>$params['text'] ] ] ]; $result = $mcy_ding->conversation->sendCorporationMessage($data); return $result; }
你好,你这个是因为msg类型的问题,需要json,你用的是数组
我支持用数组,这里之前被改过,希望能改回来。 post 改回 postJson。加 json_encode 没有意义,只是增加心智压力
public function jobMsg(Request $request) { $params = $request->post(); $mcy_ding = new McyDing($this->_config); // $access_token = $mcy_ding->access_token->get(); $data = [ "agent_id"=> "626044106", "userid_list"=>$params['ding_userid'], "msg" =>[ "msgtype"=>'markdown', "markdown"=>[ "title"=>$params['title'].'接机工作任务', "text"=>$params['text'] ] ] ]; $result = $mcy_ding->conversation->sendCorporationMessage($data); return $result; }
已经传msg了,总是提示Missing required arguments:msg