作者 邓超

x

@@ -460,18 +460,21 @@ class Home extends Base { @@ -460,18 +460,21 @@ class Home extends Base {
460 $datas = db()->cache(3600)->all(emailSql::getValues(['email'=>$emails],'`id`,`email`,`pwd_error`')); 460 $datas = db()->cache(3600)->all(emailSql::getValues(['email'=>$emails],'`id`,`email`,`pwd_error`'));
461 foreach ($datas as $k=>$v){ 461 foreach ($datas as $k=>$v){
462 if(!$v['pwd_error']){ 462 if(!$v['pwd_error']){
463 - $blacklist = app()->request('blacklist');  
464 - if(is_array($blacklist)){  
465 - $blacklist = [  
466 - 'emails' => $blacklist['emails']??[],  
467 - 'domain' => $blacklist['domain']??[],  
468 - ];  
469 - // 黑名单,7天过期时间  
470 - redis()->set('blacklist:'.$v['id'],$blacklist,86400*7);  
471 - }  
472 - // 删除  
473 - if(!$blacklist||(empty($blacklist['emails'])&&empty($blacklist['domain']))){  
474 - redis()->delete('blacklist:'.$v['id']); 463 + if(app()->requestHas('blacklist')){
  464 + $blacklist = app()->request('blacklist');
  465 + if(is_array($blacklist)){
  466 + $blacklist = [
  467 + 'emails' => $blacklist['emails']??[],
  468 + 'domain' => $blacklist['domain']??[],
  469 + ];
  470 + // 黑名单,7天过期时间
  471 + redis()->set('blacklist:'.$v['id'],$blacklist,86400*7);
  472 + }
  473 + // 删除
  474 + if(!$blacklist||(empty($blacklist['emails'])&&empty($blacklist['domain']))){
  475 + redis()->delete('blacklist:'.$v['id']);
  476 + }
  477 +
475 } 478 }
476 479
477 redis()->rPush('sync_email_lists', $v['id']); 480 redis()->rPush('sync_email_lists', $v['id']);