LoginShowControl.m 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // LoginShowControl.m
  3. // FunSDKDemo
  4. //
  5. // Created by XM on 2018/5/7.
  6. // Copyright © 2018年 XM. All rights reserved.
  7. //
  8. #import "LoginShowControl.h"
  9. #import "Header.h"
  10. @implementation LoginShowControl
  11. + (instancetype)getInstance {
  12. static dispatch_once_t onceToken;
  13. static LoginShowControl *instance;
  14. dispatch_once(&onceToken, ^{
  15. instance = [[LoginShowControl alloc] init];
  16. });
  17. return instance;
  18. }
  19. - (id)init {
  20. self = [super init];
  21. return self;
  22. }
  23. #pragma mark - 自动登陆开关
  24. + (void)setAutoLoginType:(BOOL)loginType {
  25. [NSUserDefaultData autoLoginSave:loginType];
  26. }
  27. + (BOOL)getAutoLoginType {
  28. return [NSUserDefaultData ifAutoLogin];
  29. }
  30. #pragma mark - 登陆模式,包括账号登陆,本地登陆,ap登陆
  31. LoginType appLoginType = loginTypeNone;
  32. - (void)setLoginType:(int)loginType {
  33. appLoginType = loginType;
  34. }
  35. - (int)getLoginType {
  36. return appLoginType;
  37. }
  38. #pragma mark - 登陆账号和密码
  39. NSString * userName = @""; NSString *password = @"";
  40. - (void)setLoginUserName:(NSString*)user password:(NSString*)psw {
  41. userName = user; password = psw;
  42. }
  43. - (NSString *)getLoginUserName {
  44. return userName;
  45. }
  46. - (NSString *)getLoginPassword {
  47. return password;
  48. }
  49. #pragma mark - app推送功能是否打开
  50. BOOL pushFunction = NO;
  51. - (void)setPushFunction:(BOOL)open {
  52. pushFunction = open;
  53. }
  54. - (BOOL)getPushFunction {
  55. return pushFunction;
  56. }
  57. #pragma mark - 推送token
  58. NSString *tokenStr = @"";
  59. - (void)setPushToken:(NSString *)token {
  60. tokenStr = token;
  61. }
  62. - (NSString *)getPushToken {
  63. return tokenStr;
  64. }
  65. @end