diff --git a/app/common/controller/PresetController.php b/app/common/controller/PresetController.php index 27f0c7a..ad88a8f 100644 --- a/app/common/controller/PresetController.php +++ b/app/common/controller/PresetController.php @@ -31,7 +31,8 @@ class PresetController extends BaseController { try { $corpId = $request->get('corp_id'); - $result = (new CorpFeishuAppService())->getFeishuApp($corpId); + $systemId = $request->get('system_id'); + $result = (new CorpFeishuAppService())->getFeishuApp($corpId, $systemId); return $this->success($result, '获取飞书应用信息'); } catch (\Throwable $e) { return $this->error($e->getMessage()); diff --git a/app/common/logic/CorpFeishuAppLogic.php b/app/common/logic/CorpFeishuAppLogic.php index 2073aac..e246316 100644 --- a/app/common/logic/CorpFeishuAppLogic.php +++ b/app/common/logic/CorpFeishuAppLogic.php @@ -8,9 +8,9 @@ class CorpFeishuAppLogic { - public function getFeishuApp($corpId) + public function getFeishuApp($corpId, $systemId) { - return CorpFeishuApp::where('corp_id', $corpId)->first(['id', 'corp_id', 'name', 'app_id', 'r_url', 'state']); + return CorpFeishuApp::where('corp_id', $corpId)->where('system_id', $systemId)->first(['id', 'corp_id', 'name', 'app_id', 'r_url', 'state']); } } \ No newline at end of file diff --git a/app/common/logic/PermLogic.php b/app/common/logic/PermLogic.php index 24f8e65..0977a4f 100644 --- a/app/common/logic/PermLogic.php +++ b/app/common/logic/PermLogic.php @@ -257,6 +257,8 @@ class PermLogic 'keepAlive' => true, 'authList' => $authList, 'openType' => $node->open_type, + 'isHide' => $node->is_hide == 0 ? false : true, + 'isHideTab' => $node->is_hide_tab == 0 ? false : true ], 'children' => $children, ]; diff --git a/app/common/service/CorpFeishuAppService.php b/app/common/service/CorpFeishuAppService.php index 0c10be8..ad84582 100644 --- a/app/common/service/CorpFeishuAppService.php +++ b/app/common/service/CorpFeishuAppService.php @@ -14,8 +14,8 @@ class CorpFeishuAppService $this->logic = (new CorpFeishuAppLogic()); } - public function getFeishuApp(int $corpId) + public function getFeishuApp(int $corpId, int $systemId) { - return $this->logic->getFeishuApp($corpId); + return $this->logic->getFeishuApp($corpId, $systemId); } } \ No newline at end of file diff --git a/app/queue/redis/FeishuMessage.php b/app/queue/redis/FeishuMessage.php index dacb4fc..c2663c6 100644 --- a/app/queue/redis/FeishuMessage.php +++ b/app/queue/redis/FeishuMessage.php @@ -39,7 +39,7 @@ class FeishuMessage implements Consumer // 飞书应用 $feishuApp = new CorpFeishuApp(); - $feishuAppInfo = $feishuApp->where('corp_id', $reInfo->corp_id)->first(); + $feishuAppInfo = $feishuApp->where('corp_id', $reInfo->corp_id)->where('system_id', 1)->first(); // 推送数据 $options = [ @@ -71,7 +71,7 @@ class FeishuMessage implements Consumer $reInfo = User::where('id', $info->recipient)->first(); // 飞书应用 $feishuApp = new CorpFeishuApp(); - $feishuAppInfo = $feishuApp->where('corp_id', $reInfo->corp_id)->first(); + $feishuAppInfo = $feishuApp->where('corp_id', $reInfo->corp_id)->where('system_id', 1)->first(); // 推送信息 $appId = $feishuAppInfo->app_id; $appSecret = $feishuAppInfo->app_secret; diff --git a/app/view/index/qrcode.html b/app/view/index/qrcode.html index fb6f11c..97c2a7c 100644 --- a/app/view/index/qrcode.html +++ b/app/view/index/qrcode.html @@ -16,7 +16,7 @@ // const REDIRECT_URI = encodeURIComponent('https://example.com/api/oauth/callback/feishu'); // const STATE = '随机串_防CSRF'; // // 用于跳转获取 code 的 URL - const GOTO = `https://passport.feishu.cn/suite/passport/oauth/authorize?client_id=cli_a72f13d6c022500d&redirect_uri=https://mzl.dev.hnxinyouhe.com/common/auth/feishu/auth&response_type=code&state=MZL`; + const GOTO = `https://passport.feishu.cn/suite/passport/oauth/authorize?client_id=cli_a72f13d6c022500d&redirect_uri=https://web-fdesk.hnxinyouhe.com/auth/feishu-callback&response_type=code&state=MZL`; // const GOTO = `https://open.feishu.cn/open-apis/authen/v1/authorize?app_id=cli_a73e1e6406fa501c&redirect_uri=https://mzl.dev.hnxinyouhe.com/common/auth/feishu/auth&scope=contact:user.base:readonly contact:contact.base:readonly contact:user.employee_id:readonly im:message:send_as_bot&state=xinyouhe`; // 2. 创建二维码实例 const QRLoginObj = QRLogin({