未登录处理

This commit is contained in:
2025-12-19 13:34:58 +08:00
parent ea4ecc05b4
commit 182e5b9da1
2 changed files with 16 additions and 0 deletions

View File

@@ -234,18 +234,30 @@
} }
- (void)onCenterPlusTappedInternal { - (void)onCenterPlusTappedInternal {
if (![KBUserSessionManager shared].isLoggedIn) {
[[KBUserSessionManager shared] goLoginVC];
return;
}
if (self.onCenterPlusTapped) { if (self.onCenterPlusTapped) {
self.onCenterPlusTapped(self.firstCharacter); self.onCenterPlusTapped(self.firstCharacter);
} }
} }
- (void)onLeftPlusTappedInternal { - (void)onLeftPlusTappedInternal {
if (![KBUserSessionManager shared].isLoggedIn) {
[[KBUserSessionManager shared] goLoginVC];
return;
}
if (self.onLeftPlusTapped) { if (self.onLeftPlusTapped) {
self.onLeftPlusTapped(self.secondCharacter); self.onLeftPlusTapped(self.secondCharacter);
} }
} }
- (void)onRightPlusTappedInternal { - (void)onRightPlusTappedInternal {
if (![KBUserSessionManager shared].isLoggedIn) {
[[KBUserSessionManager shared] goLoginVC];
return;
}
if (self.onRightPlusTapped) { if (self.onRightPlusTapped) {
self.onRightPlusTapped(self.thirdCharacter); self.onRightPlusTapped(self.thirdCharacter);
} }

View File

@@ -204,6 +204,10 @@
KBWeakSelf KBWeakSelf
__weak typeof(cell) weakCell = cell; __weak typeof(cell) weakCell = cell;
cell.onTapAction = ^{ cell.onTapAction = ^{
if (![KBUserSessionManager shared].isLoggedIn) {
[[KBUserSessionManager shared] goLoginVC];
return;
}
__strong typeof(weakSelf) self = weakSelf; __strong typeof(weakSelf) self = weakSelf;
HomeHotCell *strongCell = weakCell; HomeHotCell *strongCell = weakCell;
if (!self || !strongCell) { return; } if (!self || !strongCell) { return; }