正在显示
3 个修改的文件
包含
4 行增加
和
3 行删除
| @@ -15,7 +15,7 @@ function start(){ | @@ -15,7 +15,7 @@ function start(){ | ||
| 15 | // 占用当前的id,占用2小时 | 15 | // 占用当前的id,占用2小时 |
| 16 | if(redis()->add('just_sync_'.$id,time(),600)){ | 16 | if(redis()->add('just_sync_'.$id,time(),600)){ |
| 17 | go(function () use ($id){ | 17 | go(function () use ($id){ |
| 18 | - echo \Swlib\SaberGM::get('http://mail-serve.hagro.cn/v3/sync?id='.$id,['timeout'=>60]); | 18 | + echo \Swlib\SaberGM::get('http://mail-serve.hagro.cn/v3/sync?id='.$id,['timeout'=>60])->getBody()->getContents(); |
| 19 | }); | 19 | }); |
| 20 | } | 20 | } |
| 21 | }else{ | 21 | }else{ |
| @@ -35,6 +35,7 @@ class Home extends Base { | @@ -35,6 +35,7 @@ class Home extends Base { | ||
| 35 | * @time 2023/8/2 16:19 | 35 | * @time 2023/8/2 16:19 |
| 36 | */ | 36 | */ |
| 37 | public function sync(){ | 37 | public function sync(){ |
| 38 | + header("content-type:text/html; charset=utf-8"); | ||
| 38 | $id = app()->request('id'); | 39 | $id = app()->request('id'); |
| 39 | if($id && is_numeric($id)){ | 40 | if($id && is_numeric($id)){ |
| 40 | (new SyncMail($id))->sync(); | 41 | (new SyncMail($id))->sync(); |
| @@ -25,7 +25,7 @@ class SyncMail { | @@ -25,7 +25,7 @@ class SyncMail { | ||
| 25 | 25 | ||
| 26 | public function __construct(int $id, array $data) | 26 | public function __construct(int $id, array $data) |
| 27 | { | 27 | { |
| 28 | - if(php_sapi_name() == 'cli'){ | 28 | +// if(php_sapi_name() == 'cli'){ |
| 29 | $this->db = db(); | 29 | $this->db = db(); |
| 30 | 30 | ||
| 31 | // 是否是预热邮件 aicc专用 | 31 | // 是否是预热邮件 aicc专用 |
| @@ -86,7 +86,7 @@ class SyncMail { | @@ -86,7 +86,7 @@ class SyncMail { | ||
| 86 | 86 | ||
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | - } | 89 | +// } |
| 90 | 90 | ||
| 91 | 91 | ||
| 92 | 92 |
-
请 注册 或 登录 后发表评论