From 38a3d2879e1cf56a8bc0bc5e71ba61791428878c Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Thu, 18 Dec 2025 13:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=AA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=20=E9=94=AE=E7=9B=98=E7=82=B9=E5=87=BB=E5=85=85=E5=80=BC?= =?UTF-8?q?=E5=8E=BB=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CustomKeyboard/KeyboardViewController.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CustomKeyboard/KeyboardViewController.m b/CustomKeyboard/KeyboardViewController.m index dd148ec..109164e 100644 --- a/CustomKeyboard/KeyboardViewController.m +++ b/CustomKeyboard/KeyboardViewController.m @@ -192,6 +192,22 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center, } - (void)showSubscriptionPanel { + // 1) 先判断权限:未开启“完全访问”则走引导逻辑 + if (![[KBFullAccessManager shared] hasFullAccess]) { + // 未开启完全访问:保持原有引导路径 +// [KBHUD showInfo:KBLocalized(@"处理中…")]; + [[KBFullAccessManager shared] ensureFullAccessOrGuideInView:self.view]; + return; + } + // 点击充值要先判断是否登录 + // 2) 权限没问题,再判断是否登录:未登录 -> 直接拉起主 App,由主 App 负责完成登录 + if (!KBAuthManager.shared.isLoggedIn) { + NSString *schemeStr = [NSString stringWithFormat:@"%@://login?src=keyboard", KB_APP_SCHEME]; + NSURL *scheme = [NSURL URLWithString:schemeStr]; + // 从当前视图作为起点,通过响应链找到 UIApplication 再调起主 App + BOOL ok = [KBHostAppLauncher openHostAppURL:scheme fromResponder:self.view]; + return; + } [self showFunctionPanel:NO]; KBKeyboardSubscriptionView *panel = self.subscriptionView; if (!panel.superview) {