UserManager.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // UserManager.h
  3. // LiveTV
  4. //
  5. // Created by 翟玉磊 on 2019/4/22.
  6. // Copyright © 2019 翟玉磊. All rights reserved.
  7. //
  8. /*
  9. 使用方式
  10. // 引用
  11. #import "UserManager.h"
  12. // 调用
  13. [UserManager saveUserInfo:@{@"nickname":@"小张飞"}];
  14. UserInfo *model = [UserManager userInfo];
  15. NSLog(@"%@", model.nickname);
  16. */
  17. #import <Foundation/Foundation.h>
  18. NS_ASSUME_NONNULL_BEGIN
  19. @interface UserInfo : NSObject
  20. @property (nonatomic,copy)NSString *userid;//用户id
  21. @property (nonatomic,copy)NSString *avatar;//头像
  22. @property (nonatomic,copy)NSString *mobile;//手机号
  23. @property (nonatomic,copy)NSString *userName;//用户名
  24. @property (nonatomic,copy)NSString *nickname;//用户昵称
  25. @property (nonatomic,copy)NSString *birthday;//生日
  26. @property (nonatomic,copy)NSString *token;//token
  27. @property (nonatomic,copy)NSString *sex;//性别
  28. - (instancetype)initWithDictionary:(NSDictionary *)dictionary;
  29. @end
  30. @interface UserManager : NSObject
  31. /**
  32. 存储用户信息
  33. @param dic 服务器获取来的用户信息字典
  34. @return return value description
  35. */
  36. + (BOOL)saveUserInfo:(NSDictionary *)dic;
  37. /**
  38. 取用户信息
  39. @return 返回用户信息模型
  40. */
  41. + (UserInfo *)userInfo;
  42. /**
  43. 清空用户信息
  44. @return 是否清空
  45. */
  46. + (BOOL)clearUserInfo;
  47. @end
  48. NS_ASSUME_NONNULL_END