作者 邓超

1

@@ -371,28 +371,27 @@ class Home extends Base { @@ -371,28 +371,27 @@ class Home extends Base {
371 371
372 if($data){ 372 if($data){
373 $sync_num = 0; 373 $sync_num = 0;
  374 + $data['to_name'] = json_decode($data['to_name']??"[]",true);
374 375
375 HOME_INFO_BODY: 376 HOME_INFO_BODY:
  377 + $body = db()->first(bodySql::first($id));
  378 + if($body){
  379 + $data['body'] = json_decode($body['text_html'],true);
  380 + return [
  381 + 'data' => $data
  382 + ];
  383 + }
376 // 循环几次 384 // 循环几次
377 if($sync_num < 1){ 385 if($sync_num < 1){
378 - $data['to_name'] = json_decode($data['to_name']??"[]",true);  
379 - $body = db()->first(bodySql::first($id));  
380 - if($body){  
381 - $data['body'] = json_decode($body['text_html'],true);  
382 - return [  
383 - 'data' => $data  
384 - ];  
385 - }  
386 -  
387 - $mail = new Mail($email['email'],base64_decode($email['passwird']),$email['imap']); 386 + $mail = new Mail($email['email'],base64_decode($email['password']),$email['imap']);
388 387
389 if($mail->login()){ 388 if($mail->login()){
390 389
391 - $folder = db()->value(folderSql::first(dbWhere(['id'=>$data['folder_id']]),'origin_folder')); 390 + $folder = db()->value(folderSql::first(['id'=>$data['folder_id']],'origin_folder'));
392 if($folder){ 391 if($folder){
393 $ret = $mail->syncBody($folder,$data['uid'],$id); 392 $ret = $mail->syncBody($folder,$data['uid'],$id);
394 $sync_num++; 393 $sync_num++;
395 - if($ret === true){ 394 + if($ret){
396 goto HOME_INFO_BODY; 395 goto HOME_INFO_BODY;
397 } 396 }
398 } 397 }