...
|
...
|
@@ -5,6 +5,7 @@ namespace Controller; |
|
|
use Lib\Mail\Mail;
|
|
|
use Lib\Mail\MailFun;
|
|
|
use Lib\Verify;
|
|
|
use Model\bodySql;
|
|
|
use Model\emailSql;
|
|
|
use Model\folderSql;
|
|
|
use Model\listsSql;
|
...
|
...
|
@@ -358,6 +359,53 @@ class Home extends Base { |
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @author:dc
|
|
|
* @time 2023/4/1 9:24
|
|
|
*/
|
|
|
public function info(){
|
|
|
$id = app()->request('id',0,'intval');
|
|
|
// 没有,说明没有同步过来
|
|
|
$email = $this->getEmail();
|
|
|
$data = db()->first(listsSql::first(dbWhere(['id'=>$id,'email_id'=>$email['id']])));
|
|
|
|
|
|
if($data){
|
|
|
$sync_num = 0;
|
|
|
|
|
|
HOME_INFO_BODY:
|
|
|
// 循环几次
|
|
|
if($sync_num < 1){
|
|
|
$body = db()->first(bodySql::first($id));
|
|
|
if($body){
|
|
|
return [
|
|
|
'data' => [
|
|
|
'info' => $data,
|
|
|
'body' => json_decode($body['text_html'],true)
|
|
|
]
|
|
|
];
|
|
|
}
|
|
|
|
|
|
$mail = new Mail($email['email'],base64_decode($email['passwird']),$email['imap']);
|
|
|
|
|
|
if($mail->login()){
|
|
|
|
|
|
$folder = db()->value(folderSql::first(dbWhere(['id'=>$data['folder_id']]),'origin_folder'));
|
|
|
if($folder){
|
|
|
$ret = $mail->syncBody($folder,$data['uid'],$id);
|
|
|
$sync_num++;
|
|
|
if($ret === true){
|
|
|
goto HOME_INFO_BODY;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
app()->e('mail_body_error');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|