AppDelegate+login.m 901 B

12345678910111213141516171819202122232425262728293031
  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 getSelectArea];
  12. if (area == -1) {
  13. [[DataManager shared] showSKSelectAreaViewController];
  14. } else {
  15. NSDictionary* loginData = [UserDataHelper getLastLoginInfo];
  16. LogInModel* loginModel = [LogInModel mj_objectWithKeyValues:loginData];
  17. if(loginData && loginModel && loginModel.uid.length > 0 && [UserDataHelper hasLogin]) {
  18. [DataManager shared].loginModel = loginModel;
  19. [[DataManager shared] showTabBarController];
  20. } else {
  21. [DataManager shared].loginModel = nil;
  22. [[DataManager shared] showSKLoginViewController];
  23. }
  24. }
  25. }
  26. @end