Няма описание

FKUserManager.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // ApplicationModel.h
  3. // FirstLink
  4. //
  5. // Created by unicode on 14-9-28.
  6. // Copyright (c) 2014年 FirstLink. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. typedef NS_ENUM(NSInteger, ApplicationMode) {
  10. ApplicationModeVisitor,
  11. ApplicationModeLogin,
  12. };
  13. typedef NS_OPTIONS(NSUInteger, UserShareAuthority) {
  14. UserShareAuthorityNone = 0,
  15. UserShareAuthorityScan = 1 << 0,
  16. UserShareAuthorityPublic = 1 << 1,
  17. };
  18. @class User;
  19. @interface FKUserManager : NSObject
  20. @property (nonatomic, assign) ApplicationMode applicationMode;
  21. + (FKUserManager *)sharedManager;
  22. /**
  23. * 返回用户信息
  24. *
  25. * @return
  26. */
  27. - (User*)user;
  28. - (BOOL)saveUser:(User*)user;
  29. /**
  30. * 用户是否登录
  31. *
  32. * @return
  33. */
  34. + (BOOL)isUserLogin;
  35. - (BOOL)clearUser;
  36. /**
  37. * 退出本地登录状体,删除本地用户信息(如token,用户名等)
  38. *
  39. * @return
  40. */
  41. - (BOOL)localLogout;
  42. /**
  43. * 退出服务器登录,服务端清除用户登录信息
  44. *
  45. * @param success 成功回调
  46. * @param failure 失败回调
  47. */
  48. + (void)remoteLogout:(void (^)(MSGHeader *header, id responseObject))success
  49. failure:(void (^)(MSGHeader *header, NSError *error))failure;
  50. @end