From 5a701c048cc16ff4aa4c86bc6027f08a60668ae6 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Wed, 9 Jul 2025 10:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/application/api/controller/AutomaticAssign.php | 10 +++++++++- Server/application/command/SwitchFriendsCommand.php | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) 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); } // 过滤掉已切换的,保留未切换和新进来的