作者 lyh

gx

@@ -114,8 +114,9 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K @@ -114,8 +114,9 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K
114 */ 114 */
115 public function post_send_msg($param,$api_key){ 115 public function post_send_msg($param,$api_key){
116 //平台参数处理 116 //平台参数处理
117 - $this->headers['Accept-Encoding'] = 'gzip';  
118 - $this->headers['Authorization'] = $this->headers['Authorization'].$api_key; 117 +// $this->headers['Accept-Encoding'] = 'gzip';
  118 +// $this->headers['Authorization'] = $this->headers['Authorization'].$api_key;
  119 + $param['idempotencyKey'] = uniqid().time();
119 $url = $this->path.'/api/post'; 120 $url = $this->path.'/api/post';
120 return $this->http_post_ayr($url,$param,$api_key); 121 return $this->http_post_ayr($url,$param,$api_key);
121 } 122 }
@@ -137,6 +138,8 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K @@ -137,6 +138,8 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K
137 ), 138 ),
138 )); 139 ));
139 $response = curl_exec($curl); 140 $response = curl_exec($curl);
  141 + var_dump($response);
  142 + die();
140 curl_close($curl); 143 curl_close($curl);
141 return $response; 144 return $response;
142 } 145 }
@@ -61,26 +61,21 @@ class AyrReleaseController extends BaseController @@ -61,26 +61,21 @@ class AyrReleaseController extends BaseController
61 $share_info = $ayrShareLogic->ayr_share_info($this->param['share_id']); 61 $share_info = $ayrShareLogic->ayr_share_info($this->param['share_id']);
62 //验证发送平台 62 //验证发送平台
63 $ayrShareLogic->verify_param($share_info); 63 $ayrShareLogic->verify_param($share_info);
64 - $data = [  
65 - 'images'=>$this->param['images'],  
66 - ];  
67 - if(isset($this->param['images']) && !empty($this->param['images'])){  
68 $data['images'] = $this->param['images']; 64 $data['images'] = $this->param['images'];
69 - }  
70 if(isset($this->param['video']) && !empty($this->param['video'])){ 65 if(isset($this->param['video']) && !empty($this->param['video'])){
71 $data['files'] = $this->param['video']; 66 $data['files'] = $this->param['video'];
72 } 67 }
73 //参数处理 68 //参数处理
74 - $this->param['mediaUrls'] = $ayrReleaseLogic->image_file_param($data); 69 +// $this->param['mediaUrls'] = $ayrReleaseLogic->image_file_param($data);
75 //时间处理 70 //时间处理
76 - $datetime = new \DateTime($this->param['idempotency_key']); 71 + $datetime = new \DateTime($this->param['schedule_date']);
77 $formattedTime = $datetime->format("Y-m-d\TH:i:s\Z"); 72 $formattedTime = $datetime->format("Y-m-d\TH:i:s\Z");
78 //统一生成发布 73 //统一生成发布
79 $param = [ 74 $param = [
80 'post'=>$this->param['content'], 75 'post'=>$this->param['content'],
81 'platforms'=>$this->param['platforms'], 76 'platforms'=>$this->param['platforms'],
82 - 'mediaUrls'=>$this->param['mediaUrls'],//参数处理  
83 - 'idempotencyKey'=>$formattedTime,//时间(如是过去时间,立即发布) 77 +// 'mediaUrls'=>$this->param['mediaUrls'],//参数处理
  78 + 'scheduleDate'=>$formattedTime,//时间(如是过去时间,立即发布)
84 ]; 79 ];
85 //发送请求发布社交文章 80 //发送请求发布社交文章
86 $res = $ayrShare->post_send_msg($param,$share_info['profile_key']); 81 $res = $ayrShare->post_send_msg($param,$share_info['profile_key']);
@@ -25,11 +25,11 @@ class AyrReleaseRequest extends FormRequest @@ -25,11 +25,11 @@ class AyrReleaseRequest extends FormRequest
25 return [ 25 return [
26 'title'=>'required', 26 'title'=>'required',
27 'images'=>'required|array', 27 'images'=>'required|array',
28 - 'video'=>'required', 28 +// 'video'=>'required',
29 'content'=>'required', 29 'content'=>'required',
30 'share_id'=>'required', 30 'share_id'=>'required',
31 'platforms'=>'required|array', 31 'platforms'=>'required|array',
32 - 'idempotency_key'=>'required', 32 + 'schedule_date'=>'required',
33 ]; 33 ];
34 } 34 }
35 35
@@ -179,7 +179,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -179,7 +179,7 @@ Route::middleware(['bloginauth'])->group(function () {
179 Route::any('/add', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'add'])->name('dept_user_add'); 179 Route::any('/add', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'add'])->name('dept_user_add');
180 Route::any('/info', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'info'])->name('dept_user_info'); 180 Route::any('/info', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'info'])->name('dept_user_info');
181 Route::post('/edit', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'edit'])->name('dept_user_edit'); 181 Route::post('/edit', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'edit'])->name('dept_user_edit');
182 - Route::any('/delete', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'delete'])->name('dept_user_delete'); 182 + Route::any('/set_admin', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'set_admin'])->name('dept_user_set_admin');
183 183
184 }); 184 });
185 }); 185 });