1:修改ios26tabbar的问题

2:修改键盘AI点击必须要登录装填
This commit is contained in:
2026-02-26 19:38:17 +08:00
parent 82222afd76
commit 69bd2b2af9
6 changed files with 90 additions and 30 deletions

View File

@@ -12,6 +12,7 @@
#import "KBChatMessage.h" #import "KBChatMessage.h"
#import "KBChatPanelView.h" #import "KBChatPanelView.h"
#import "KBFunctionView.h" #import "KBFunctionView.h"
#import "KBFullAccessManager.h"
#import "KBHostAppLauncher.h" #import "KBHostAppLauncher.h"
#import "KBInputBufferManager.h" #import "KBInputBufferManager.h"
#import "KBKey.h" #import "KBKey.h"
@@ -32,6 +33,38 @@
} }
KBKeyboardPanelMode fromMode = self.kb_panelMode; KBKeyboardPanelMode fromMode = self.kb_panelMode;
// AI 访
if (mode == KBKeyboardPanelModeFunction &&
![[KBFullAccessManager shared] ensureFullAccessOrGuideInView:self.view]) {
return;
}
// mode Function
BOOL islogin = YES;
if (mode == KBKeyboardPanelModeFunction) {
[[KBAuthManager shared] reloadFromKeychain];
islogin = KBAuthManager.shared.isLoggedIn;
}
#if DEBUG
if (mode == KBKeyboardPanelModeFunction) {
NSString *token = [KBAuthManager shared].current.accessToken ?: @"";
NSLog(@"[AuthTrace][Ext] tapAI mode=%ld isLoggedIn=%d tokenLen=%lu",
(long)mode, islogin, (unsigned long)token.length);
}
#endif
if (mode == KBKeyboardPanelModeFunction && !islogin) {
[KBHUD showInfo:KBLocalized(@"请先登录后使用AI功能")];
NSString *schemeStr =
[NSString stringWithFormat:@"%@://login?src=keyboard", KB_APP_SCHEME];
NSURL *scheme = [NSURL URLWithString:schemeStr];
BOOL ok = [KBHostAppLauncher openHostAppURL:scheme fromResponder:self.view];
if (!ok) {
[KBHUD showInfo:KBLocalized(@"请回到桌面手动打开App登录")];
}
return;
}
self.kb_panelMode = mode; self.kb_panelMode = mode;
// //
@@ -46,14 +79,6 @@
// 2) // 2)
switch (mode) { switch (mode) {
case KBKeyboardPanelModeFunction: case KBKeyboardPanelModeFunction:
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 kb_setFunctionPanelVisible:YES]; [self kb_setFunctionPanelVisible:YES];
break; break;
case KBKeyboardPanelModeChat: case KBKeyboardPanelModeChat:

View File

@@ -99,10 +99,22 @@ static NSString * const kKBSessionInstallFlagKey = @"KBSession.installInitialize
// Keychain KBAuthManager // Keychain KBAuthManager
NSString *token = user.token; NSString *token = user.token;
if (token.length > 0) { if (token.length > 0) {
[[KBAuthManager shared] saveAccessToken:token BOOL saveOK = [[KBAuthManager shared] saveAccessToken:token
refreshToken:nil refreshToken:nil
expiryDate:nil expiryDate:nil
userIdentifier:nil]; userIdentifier:nil];
#if DEBUG
NSLog(@"[AuthTrace][App] saveAccessToken tokenLen=%lu saveOK=%d",
(unsigned long)token.length, saveOK);
#endif
// reload 便
[[KBAuthManager shared] reloadFromKeychain];
#if DEBUG
NSString *savedToken = [KBAuthManager shared].current.accessToken ?: @"";
NSLog(@"[AuthTrace][App] reloadAfterSave isLoggedIn=%d tokenLen=%lu",
[KBAuthManager shared].isLoggedIn,
(unsigned long)savedToken.length);
#endif
} }
// App/使 // App/使

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "微信图片_20260226192149_128_935 (1).png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

View File

@@ -213,7 +213,7 @@ static NSString * const KBChatSessionDidResetNotification = @"KBChatSessionDidRe
// UI // UI
[self.backgroundImageView sd_setImageWithURL:[NSURL URLWithString:persona.coverImageUrl] [self.backgroundImageView sd_setImageWithURL:[NSURL URLWithString:persona.coverImageUrl]
placeholderImage:[UIImage imageNamed:@"placeholder_bg"]]; placeholderImage:[UIImage imageNamed:@"ai_placehode_icon"]];
[self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:persona.avatarUrl] [self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:persona.avatarUrl]
placeholderImage:[UIImage imageNamed:@"placeholder_avatar"]]; placeholderImage:[UIImage imageNamed:@"placeholder_avatar"]];
self.nameLabel.text = persona.name; self.nameLabel.text = persona.name;

View File

@@ -28,5 +28,7 @@
<array> <array>
<string>audio</string> <string>audio</string>
</array> </array>
<key>UIDesignRequiresCompatibility</key>
<true/>
</dict> </dict>
</plist> </plist>