AppDelegate+login.m 954 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // AppDelegate+login.m
  3. // Overseas Watch
  4. //
  5. // Created by 刘振兴 on 2023/11/28.
  6. // Copyright © 2023 BaH Cy. All rights reserved.
  7. //
  8. #import "AppDelegate+login.h"
  9. @implementation AppDelegate (login)
  10. + (void)checkLogin {
  11. int area = [UserDataHelper getLoginType];
  12. if (area == -1) {
  13. [[DataManager shared] showSKSelectAreaViewController];
  14. } else {
  15. [ServerManager resetServerCategory];
  16. NSDictionary* loginData = [UserDataHelper getLastLoginInfo];
  17. LogInModel* loginModel = [LogInModel mj_objectWithKeyValues:loginData];
  18. if(loginData && loginModel && loginModel.uid.length > 0 && [UserDataHelper hasLogin]) {
  19. [DataManager shared].loginModel = loginModel;
  20. [[DataManager shared] showTabBarController];
  21. } else {
  22. [DataManager shared].loginModel = nil;
  23. [[DataManager shared] showSKLoginViewController];
  24. }
  25. }
  26. }
  27. @end