This commit is contained in:
2025-12-04 19:12:34 +08:00
parent 8f63741d8c
commit 64887054e0
18 changed files with 331 additions and 50 deletions

View File

@@ -10,6 +10,7 @@
#import "KBLoginVM.h"
#import "KBUser.h"
#import "AppDelegate.h"
#import "KBEmailLoginVC.h"
@interface KBRegistVerEmailVC ()
@@ -32,6 +33,11 @@
[self kb_addTapToDismissKeyboard];
[self setupUI];
//
NSString *email = self.params[@"mailAddress"];
[self.loginVM sendVerifyMailWithEmail:email withCompletion:^(BOOL success, NSError * _Nullable error) {
}];
}
#pragma mark - UI
@@ -88,7 +94,7 @@
return;
}
KBLOG(@"KBRegistVerEmailVC confirm with code=%@", code);
self.params[@"code"] = code;
self.params[@"verifyCode"] = code;
NSNumber *genderNumber = [self kb_localGenderParamIfAvailable];
if (genderNumber != nil) {
self.params[@"gender"] = genderNumber;
@@ -98,11 +104,20 @@
[KBHUD showInfo:KBLocalized(@"Signed in successfully")];
// TabBar
dispatch_async(dispatch_get_main_queue(), ^{
id<UIApplicationDelegate> appDelegate = UIApplication.sharedApplication.delegate;
if ([appDelegate respondsToSelector:@selector(setupRootVC)]) {
AppDelegate *delegate = (AppDelegate *)appDelegate;
[delegate toMainTabbarVC];
}
KBEmailLoginVC *vc = [[KBEmailLoginVC alloc] init];
[KB_CURRENT_NAV pushViewController:vc animated:true];
// id<UIApplicationDelegate> appDelegate = UIApplication.sharedApplication.delegate;
// if ([appDelegate respondsToSelector:@selector(setupRootVC)]) {
// AppDelegate *delegate = (AppDelegate *)appDelegate;
//// [delegate toMainTabbarVC];
// delegate.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// delegate.window.backgroundColor = [UIColor whiteColor];
// [delegate.window makeKeyAndVisible];
// UIViewController *rootVC = nil;
// rootVC = [[BaseTabBarController alloc] init];
// self.window.rootViewController = rootVC;
// }
});
} else {
NSString *msg = error.localizedDescription ?: KBLocalized(@"Sign-in failed");