LoginViewController.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. //
  2. // LoginViewController.m
  3. // kneet
  4. //
  5. // Created by Jason Lee on 2/4/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. @import QuartzCore;
  9. #import "RequestHandler.h"
  10. #import "CustomTextField.h"
  11. #import "CustomButton.h"
  12. #import "JDJSONModel.h"
  13. #import "LoginModel.h"
  14. #import "LoginViewController.h"
  15. #import "CustomLabel.h"
  16. #import "CustomCheckBox.h"
  17. #import "KeychainItemWrapper.h"
  18. #import "NewMobileViewController.h"
  19. #import "ValidateUtil.h"
  20. #import "CustomAlertView.h"
  21. #import "CustomImageView.h"
  22. #import "PwdPopupView.h"
  23. #import "QuizSetViewController.h"
  24. #import "TempPwViewController.h"
  25. //#import "MobilesOverViewController.h"
  26. //#import "InvitationListViewController.h"
  27. /**
  28. ID / PW Input Box Text Color
  29. - 기본 : kUITextColor01
  30. - Hint : kUITextColor03
  31. - Disable : kUITextColor06
  32. 로그인 유지 / 아이디 저장 Text Color : kUITextColor01
  33. 아이디 찾기 / 비밀번호 찾기 / 회원가입하기 Text Color
  34. - 아이디 찾기,비밀번호 찾기 : kUITextColor01
  35. - 회원가입 하기 : kUITextColor04
  36. **/
  37. @interface LoginViewController () <CustomTextFieldDelegate,dismissQuizViewDelegate> {
  38. }
  39. @end
  40. #pragma mark - Class Definition
  41. @implementation LoginViewController
  42. - (void)viewDidLoad {
  43. [super viewDidLoad];
  44. // Do any additional setup after loading the view.
  45. [self initUI];
  46. [self prepareViewDidLoad];
  47. }
  48. - (void)initUI {
  49. _btnLogin.enabled = NO;
  50. [self.btnLogin setBackgroundImage:[UIImage imageNamed:@"img_btn_common_active"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
  51. [self.btnLogin setBackgroundImage:[UIImage imageNamed:@"img_btn_common_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
  52. [self.btnLogin setBackgroundImage:[UIImage imageNamed:@"img_btn_common_disable"] forState:UIControlStateDisabled capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
  53. [self.lblFindId setHidden:YES];
  54. CGRect screen = [UIScreen mainScreen].bounds;
  55. if (screen.size.height == 480) {//iphone4s
  56. [_imgvBg setImage:[UIImage imageNamed:@"img_login_bg_4inch"]];
  57. } if (screen.size.height == 667.0f) {//iphone6
  58. _constraintLeftPadding.constant *= 1.25;
  59. _constraintRightPadding.constant *= 1.25;
  60. } else if (screen.size.height == 736.0f) {//iphone6 plus
  61. _constraintLeftPadding.constant *= 1.5;
  62. _constraintRightPadding.constant *= 1.5;
  63. }
  64. // [self.view layoutIfNeeded];
  65. _txtEmail.customTextFieldSuperview = CustomTextFieldSuperviewIsScrollView;
  66. _txtPasswd.customTextFieldSuperview = CustomTextFieldSuperviewIsScrollView;
  67. _txtPasswd.secureTextEntry = YES;
  68. _txtEmail.keyboardType = UIKeyboardTypeDefault;
  69. _txtPasswd.keyboardType = UIKeyboardTypeDefault;
  70. _txtEmail.returnKeyType = UIReturnKeyNext;
  71. _txtPasswd.returnKeyType = UIReturnKeyDone;
  72. _txtPasswd.delegate = self;
  73. _txtEmail.delegate = self;
  74. //Localization
  75. [_chkAutoLogin setTitle:NSLocalizedString(@"로그인 유지", @"로그인 유지") forState:UIControlStateNormal];
  76. [_chkIdSave setTitle:NSLocalizedString(@"아이디 저장", @"아이디 저장") forState:UIControlStateNormal];
  77. _txtEmail.placeholder = NSLocalizedString(@"아이디", @"아이디");
  78. _txtPasswd.placeholder = NSLocalizedString(@"비밀번호", @"비밀번호");
  79. _lblSignUp.text = NSLocalizedString(@"회원가입하기", @"회원가입하기");
  80. _lblFindId.text = NSLocalizedString(@"아이디/비번찾기", @"아이디/비번찾기");
  81. // [_lblSignUp setUnderLine:_lblSignUp.text];
  82. [_lblSignUp addTouchEventHandler:^(id label) {
  83. [self lblSignUpTouched];
  84. }];
  85. [_lblFindId setUnderLine:_lblFindId.text];
  86. [_lblFindId addTouchEventHandler:^(id label) {
  87. [self lblFindIdTouched];
  88. }];
  89. }
  90. - (void)prepareViewDidLoad {
  91. [RequestHandler handler].authorization = nil;
  92. BOOL autoLogin = [[[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_AUTO_LOGIN] boolValue];
  93. BOOL idSave = [[[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_SAVE_ID] boolValue];
  94. _chkAutoLogin.checked = [[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_AUTO_LOGIN] != nil ? autoLogin : YES;
  95. _chkIdSave.checked = [[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_SAVE_ID] != nil ? idSave : YES;
  96. if (autoLogin) {
  97. [self requestAutoLogin];
  98. // _txtEmail.text = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  99. // _txtPasswd.text = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_PWD];
  100. //
  101. // [self btnLogInTouched:_btnLogin];
  102. }
  103. if (idSave) {
  104. NSLog(@"Save ID : %@", [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID]);
  105. _txtEmail.text = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  106. }
  107. }
  108. #pragma mark - Main Logic
  109. - (void)requestLogin {
  110. SocketRequestModel *request = [[SocketRequestModel alloc] initWithMsgType:MSG_TYPE_LOGIN];
  111. NSDictionary *param = @{@"member_id": [_txtEmail.text trim],
  112. @"password": [_txtPasswd.text trim],
  113. @"os_type": MOBILE_DEVICE_TYPE,
  114. @"device_token": [JDFacade facade].APNSToken ? [JDFacade facade].APNSToken : ksEmptyString};
  115. [request setRequestMsg:param];
  116. [self sendDataToSocket:request modelClass:[LoginModel class] isLoading:YES];
  117. }
  118. //자동로그인 요청
  119. - (void)requestAutoLogin {;
  120. LoginModel *tmpInfo = [[LoginModel alloc] init];
  121. tmpInfo.memberId = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  122. tmpInfo.authToken = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_AUTOTOKEN];
  123. SocketRequestModel *request = [[SocketRequestModel alloc] initWithMsgType:MSG_TYPE_AUTO_LOGIN];
  124. NSDictionary *param = @{@"Authorization": tmpInfo.authorization,
  125. @"device_token": [JDFacade facade].APNSToken ? [JDFacade facade].APNSToken : ksEmptyString,
  126. @"os_type": MOBILE_DEVICE_TYPE};
  127. [request setRequestMsg:param];
  128. [self sendDataToSocket:request modelClass:[LoginModel class] isLoading:YES];
  129. // NSString *path = [NSString stringWithFormat:API_GET_SIGN_IN_AUTO];
  130. //
  131. // [[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:parameter modelClass:[LoginModel class] completion:^(id responseObject) {
  132. // if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
  133. // return;
  134. // }
  135. //
  136. // LoginModel *loginInfo = (LoginModel *)responseObject;
  137. //
  138. // if (loginInfo) {//API 성공 ,함
  139. // [self actionForLoginSucceed:loginInfo];
  140. //
  141. // }
  142. // } failure:^(id errorObject) {
  143. // JDErrorModel *error = (JDErrorModel *)errorObject;
  144. //
  145. // if ([error.errorCode isEqualToString:API_RESPONSE_UNAUTHORIZED_DEVICE]) {//새로운 단말 인증 필요
  146. // [self actionForNeedsRegisteringNewDevice:error.nickname];
  147. // } else {
  148. // [[JDFacade facade] alert:error.errorMessage];
  149. // }
  150. // }];
  151. }
  152. //인증 메일 재요청
  153. - (void)requestAuthMail {
  154. //parameters
  155. NSDictionary *parameter = @{@"email_id": [JDFacade facade].tmpEmailId};
  156. NSString *path = [NSString stringWithFormat:API_POST_AUTH_MAIL];
  157. [[RequestHandler handler] sendAsyncPostRequestAPIPath:path parameters:parameter modelClass:[JDJSONModel class] completion:^(id responseObject) {
  158. if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
  159. return;
  160. }
  161. JDJSONModel *result = (JDJSONModel *) responseObject;
  162. if (result) {//API 성공 ,
  163. [[JDFacade facade] toast:NSLocalizedString(@"인증 메일이 발송되었습니다", @"인증 메일이 발송되었습니다")];
  164. }
  165. } failure:^(id errorObject) {
  166. JDErrorModel *error = (JDErrorModel *)errorObject;
  167. [[JDFacade facade] alert:error.errorMessage];
  168. }];
  169. }
  170. //로그인 이후 처리.
  171. - (void)actionForLoginSucceed:(LoginModel *)loginInfo {
  172. if (loginInfo) {//API 성공함
  173. [JDFacade facade].loginUser = loginInfo;
  174. // [JDFacade facade].loginUser.gradeCode = KNEET_MEMBER_MASTER;
  175. // [JDFacade facade].loginUser.level = 90;
  176. NSLog(@"loginUser : %@", [JDFacade facade].loginUser);
  177. if ([[JDFacade facade].loginUser.emailId isEqualToString:[JDFacade facade].tmpEmailId]) {
  178. [JDFacade facade].tmpEmailId = ksEmptyString;
  179. }
  180. if ([[JDFacade facade].loginUser.emailId isEqualToString:[JDFacade facade].loginUser.newEmailId]) {//이메일 변경 요청 중
  181. [JDFacade facade].loginUser.newEmailId = ksEmptyString;
  182. }
  183. [RequestHandler handler].authorization = loginInfo.authorization;
  184. [[JDFacade facade] storeObjectToUserDefaults:@(_chkAutoLogin.checked) forKey:USDEF_APP_AUTO_LOGIN];
  185. [[JDFacade facade] storeObjectToUserDefaults:@(_chkIdSave.checked) forKey:USDEF_APP_SAVE_ID];
  186. if (_chkAutoLogin.checked) {//자동로그인 설정 시, 인증 토큰 저장
  187. [[JDFacade facade] storeObjectToKeychain:loginInfo.memberId forKey:USDEF_SESSION_LOGIN_ID];
  188. [[JDFacade facade] storeObjectToKeychain:loginInfo.authToken forKey:USDEF_SESSION_AUTOTOKEN];
  189. } else {
  190. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_AUTOTOKEN];
  191. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_LOGIN_PWD];
  192. if (!_chkIdSave.checked) {
  193. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_LOGIN_ID];
  194. }
  195. }
  196. if (_chkIdSave.checked) {
  197. [[JDFacade facade] storeObjectToKeychain:[_txtEmail.text trim] forKey:USDEF_SESSION_LOGIN_ID];
  198. } else {
  199. if (!_chkAutoLogin.checked) {
  200. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_LOGIN_ID];
  201. }
  202. }
  203. [self actionAfterLogin];
  204. }
  205. }
  206. //퀴즈 설정 메뉴 dismiss 시
  207. - (void)dismissQuizView {
  208. [self actionAfterInvitaion];
  209. }
  210. //홈그룹 체크 및 대시보드 이동
  211. - (void)actionAfterLogin {
  212. if ([[JDFacade facade].loginUser.quiz isEqualToString:@""]) {
  213. QuizSetViewController *vc = (QuizSetViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"QuizSetViewController" storyboardName:@"Main"];
  214. vc.delegate = self;
  215. [self presentViewController:vc animated:YES completion:nil];
  216. return;
  217. }
  218. if ([[JDFacade facade].loginUser.invitationsCount integerValue] > 0) {
  219. [self actionForInvitation];
  220. return;
  221. }
  222. //임시 비밀번호 체크 후 이동
  223. if ([JDFacade facade].loginUser.tempPasswordYn && [[JDFacade facade].loginUser.tempPasswordYn boolValue]) {
  224. TempPwViewController *vc = (TempPwViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"TempPwSetViewController" storyboardName:@"SignUp"];
  225. [self presentViewController:vc animated:YES completion:nil];
  226. return;
  227. }
  228. [self actionAfterInvitaion];
  229. }
  230. //초대알림 화면으로 이동
  231. - (void)actionForInvitation {
  232. [[JDFacade facade] loadInvitationView];
  233. }
  234. //초대화면 액션이 종료된 후,
  235. - (void)actionAfterInvitaion {
  236. //메인으로 이동
  237. [self gotoMainView];
  238. }
  239. //새로운 단말 인증 필요 - 화면 이동
  240. - (void)actionForNeedsRegisteringNewDevice:(NSString *)nickname {
  241. NewMobileViewController *vc = (NewMobileViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"NewMobileViewController" storyboardName:@"SignUp"];
  242. vc.checkedAutoLogin = _chkAutoLogin.checked;
  243. vc.nickname = nickname;
  244. [[JDFacade facade] presentViewControllerByPush:vc pvc:self];
  245. }
  246. //단말대수 초과
  247. - (void)actionForMobilesOver:(NSArray<MobileDeviceModel> *)deviceList {
  248. //SHA-2
  249. }
  250. //인증대기중 - 화면 이동
  251. - (void)actionForWaiting {
  252. NSString *message1 = [NSString stringWithFormat:@"%@에서\n인증 메일을 확인하세요", [JDFacade facade].tmpEmailId];
  253. NSString *message2 = @"\n\n메일을 확인할 수 없는 경우에는\n스팸 메일함을 확인해보세요";
  254. CustomAlertView *alert = [[CustomAlertView alloc] initWithTitle:@"메일을 확인하세요" message:[NSString stringWithFormat:@"%@%@", message1, message2] delegate:nil OKButtonTitle:@"확인" cancelButtonTitle:nil];
  255. [alert.lblMessage1 setColor:kUITextColor02 text:message1];
  256. [alert showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
  257. if (buttonIndex == 1) {//재발송
  258. [self requestAuthMail];
  259. }
  260. }];
  261. }
  262. - (void)gotoMainView {
  263. // UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"SignUpCompleteViewController" storyboardName:@"SignUp"];
  264. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"MainViewController" storyboardName:@"Main"];
  265. [JDFacade facade].mainViewController = (MainViewController *)vc;
  266. [[JDFacade facade].appDelegate.window setRootViewController:vc];
  267. }
  268. - (void)requestLogout {
  269. [JDFacade facade].loginUser = nil;
  270. [self actionAfterLogout];
  271. // NSDictionary *param = @{API_AUTHORIZATION_KEY: [[JDFacade facade].loginUser authorization],
  272. // @"message_type": @"auth.out"};
  273. //
  274. // [self sendDataToSocket:param];
  275. //parameters
  276. // [self actionAfterLogout];
  277. // NSString *path = [NSString stringWithFormat:API_POST_SIGN_OUT];
  278. //
  279. // [[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:nil modelClass:[JDJSONModel class] completion:^(id responseObject) {
  280. // [self actionAfterLogout];
  281. //
  282. // } failure:^(id errorObject) {
  283. // JDErrorModel *error = (JDErrorModel *)errorObject;
  284. // [[JDFacade facade] alert:error.errorMessage];
  285. // }];
  286. }
  287. - (void)actionAfterLogout {
  288. //자동 로그인 설정 - 취소
  289. [[JDFacade facade] storeObjectToUserDefaults:@(NO) forKey:USDEF_APP_AUTO_LOGIN];
  290. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_AUTOTOKEN];
  291. if (![[[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_SAVE_ID] boolValue]) {
  292. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_LOGIN_ID];
  293. }
  294. [JDFacade facade].loginUser = nil;
  295. [self closeSocket];
  296. //root view 변경
  297. [[JDFacade facade].appDelegate.window setRootViewController:self];
  298. }
  299. #pragma mark - UI Events
  300. - (IBAction)btnLogInTouched:(id)sender {
  301. //#ifdef DEBUG_MODE
  302. // if ([_txtEmail.text isEmptyString]) {
  303. // _txtEmail.text = @"asura77";//@"smiles1080";
  304. // }
  305. //
  306. // if ([_txtPasswd.text isEmptyString]) {
  307. // _txtPasswd.text = @"12345678a";//@"12341234aa";
  308. //
  309. // }
  310. //#endif
  311. // TODO : 아이디 형식 검사할것
  312. // if (![ValidateUtil validateTextfiled:_txtEmail type:ValidateTypeEmail title:@"이메일" ]) {
  313. // return;
  314. // }
  315. if (![ValidateUtil validateTextfiled:_txtEmail type:ValidateTypeNull title:@"비밀번호" ]) {
  316. return;
  317. }
  318. [JDFacade facade].tmpEmailId = [_txtEmail.text trim];
  319. [JDFacade facade].tmpPassword = [_txtPasswd.text trim];
  320. [self requestLogin];
  321. }
  322. //회원가입 호출
  323. - (void)lblSignUpTouched {
  324. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"SignUpTypeSelectViewController" storyboardName:@"SignUp"];
  325. UINavigationController *m_navi =[[UINavigationController alloc]initWithRootViewController:vc];
  326. [self presentViewController:m_navi animated:YES completion:nil];
  327. }
  328. - (void)lblFindIdTouched {
  329. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ResetPwdViewController" storyboardName:@"SignUp"];
  330. [self presentViewController:vc animated:YES completion:nil];
  331. }
  332. // 아이디 찾기 호출
  333. - (IBAction)btnIdFindTouched:(id)sender {
  334. NSLog(@"아이디 찾기");
  335. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"IdFindViewController" storyboardName:@"SignUp"];
  336. UINavigationController *m_navi =[[UINavigationController alloc]initWithRootViewController:vc];
  337. [self presentViewController:m_navi animated:YES completion:nil];
  338. }
  339. // 비밀번호 찾기 호출
  340. - (IBAction)btnPwFindTouched:(id)sender {
  341. NSLog(@"비밀번호 찾기");
  342. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"PwFindViewController" storyboardName:@"SignUp"];
  343. UINavigationController *m_navi =[[UINavigationController alloc]initWithRootViewController:vc];
  344. [self presentViewController:m_navi animated:YES completion:nil];
  345. }
  346. #pragma mark - CustomTextField
  347. - (BOOL)textFieldShouldReturn:(UITextField *)textField {
  348. if ([textField isEqual:_txtEmail])
  349. {
  350. [_txtPasswd becomeFirstResponder];
  351. }
  352. if ([textField isEqual:_txtPasswd])
  353. {
  354. [self btnLogInTouched:nil];
  355. }
  356. return YES;
  357. }
  358. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
  359. NSString *text = [textField.text stringByReplacingCharactersInRange:range withString:string];
  360. NSString *userID = [textField isEqual:_txtEmail] ? text : _txtEmail.text;
  361. NSString *userPW = [textField isEqual:_txtPasswd] ? text : _txtPasswd.text;
  362. _btnLogin.enabled = userID.length >= 6 && userPW.length >= 8;
  363. return YES;
  364. }
  365. //다음
  366. - (void)moveToNextField:(id)sender {
  367. [_txtPasswd becomeFirstResponder] ;
  368. }
  369. #pragma mark - SocketService
  370. - (void) socketDidReceiveMessage:(id)message result:(SocketModel *)result
  371. {
  372. SWITCH(result.messageType)
  373. {
  374. CASE (MSG_TYPE_LOGIN)
  375. {
  376. [[JDFacade facade] loadIndicator:NO allowUserInteraction:YES];
  377. if (result.isSuccess) {
  378. LoginModel *loginInfo = (LoginModel *)message;
  379. [self actionForLoginSucceed:loginInfo];
  380. }
  381. // else
  382. // {
  383. // [[JDFacade facade] alertTitle:@"알림" message:result.resultMsg];
  384. // }
  385. break;
  386. }
  387. CASE (MSG_TYPE_AUTO_LOGIN)
  388. {
  389. [[JDFacade facade] loadIndicator:NO allowUserInteraction:YES];
  390. if (result.isSuccess) {
  391. LoginModel *loginInfo = (LoginModel *)message;
  392. loginInfo.memberId = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  393. loginInfo.authToken = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_AUTOTOKEN];
  394. [self actionForLoginSucceed:loginInfo];
  395. }
  396. // else
  397. // {
  398. // [[JDFacade facade] alertTitle:@"알림" message:result.resultMsg];
  399. // }
  400. break;
  401. }
  402. CASE(@"auth.out")
  403. {
  404. if (result.isSuccess) {
  405. [self actionAfterLogout];
  406. }
  407. else {
  408. NSLog(@"Result Info : %@", result);
  409. }
  410. }
  411. DEFAULT
  412. {
  413. break;
  414. }
  415. }
  416. }
  417. - (void) socketDidFailWithError:(NSError *)error {
  418. [[JDFacade facade] loadIndicator:NO allowUserInteraction:YES];
  419. }
  420. #pragma mark - MemoryWarning
  421. - (void)didReceiveMemoryWarning
  422. {
  423. [super didReceiveMemoryWarning];
  424. // Dispose of any resources that can be recreated.
  425. }
  426. @end