diff --git a/Server/application/api/controller/AutomaticAssign.php b/Server/application/api/controller/AutomaticAssign.php index 88e0048f..0a10e9b6 100644 --- a/Server/application/api/controller/AutomaticAssign.php +++ b/Server/application/api/controller/AutomaticAssign.php @@ -7,6 +7,7 @@ use app\api\model\CompanyModel; use Library\S2\Logics\AccountLogic; use think\Db; use think\facade\Request; +use think\facade\Cache; /** * 账号管理控制器 @@ -174,7 +175,7 @@ class AutomaticAssign extends BaseController public function allotWechatFriend($data = [],$isInner = false) { // 获取授权token - $authorization = trim($this->request->header('authorization', $this->authorization)); + $authorization = $this->authorization; if (empty($authorization)) { if($isInner){ return json_encode(['code'=>500,'msg'=>'缺少授权信息']); @@ -216,6 +217,13 @@ class AutomaticAssign extends BaseController return successJson([], '微信好友分配成功'); } } else { + + if ($result == '无效路径或登录状态失效'){ + Cache::rm('system_authorization_token'); + Cache::rm('system_refresh_token'); + } + + if($isInner){ return json_encode(['code'=>500,'msg'=>$result]); }else{ diff --git a/Server/application/command/SwitchFriendsCommand.php b/Server/application/command/SwitchFriendsCommand.php index 09b7c69b..c1035cb0 100644 --- a/Server/application/command/SwitchFriendsCommand.php +++ b/Server/application/command/SwitchFriendsCommand.php @@ -61,7 +61,6 @@ class SwitchFriendsCommand extends Command }else{ $output->writeln('切换好友:' . $friendId . ' 到账号:' . $friend['accountId'] .' 结果:' .$res['msg']); } - sleep(1); } // 过滤掉已切换的,保留未切换和新进来的