|
|
@@ -69,10 +69,10 @@
|
|
|
_txtPasswd.customTextFieldSuperview = CustomTextFieldSuperviewIsScrollView;
|
|
|
_txtPasswd.secureTextEntry = YES;
|
|
|
|
|
|
- _txtEmail.keyboardType = UIKeyboardTypeEmailAddress;
|
|
|
+ _txtEmail.keyboardType = UIKeyboardTypeDefault;
|
|
|
_txtPasswd.keyboardType = UIKeyboardTypeDefault;
|
|
|
|
|
|
- _txtEmail.returnKeyType = UIReturnKeyDone;
|
|
|
+ _txtEmail.returnKeyType = UIReturnKeyNext;
|
|
|
_txtPasswd.returnKeyType = UIReturnKeyDone;
|
|
|
|
|
|
_txtPasswd.delegate = self;
|
|
|
@@ -110,40 +110,42 @@
|
|
|
#pragma mark - Main Logic
|
|
|
|
|
|
- (void)requestLogin {
|
|
|
- NSDictionary *param = @{@"email_id": _txtEmail.text,
|
|
|
+ NSDictionary *param = @{@"member_id": _txtEmail.text,
|
|
|
@"password": _txtPasswd.text,
|
|
|
- @"service_id": MOBILE_SERVICE_ID,
|
|
|
+// @"service_id": MOBILE_SERVICE_ID,
|
|
|
@"os_type": MOBILE_DEVICE_TYPE,
|
|
|
- @"device_sn": [JDFacade facade].deviceUUID,
|
|
|
- @"device_name": [CommonUtil deviceName],
|
|
|
+// @"device_sn": [JDFacade facade].deviceUUID,
|
|
|
+// @"device_name": [CommonUtil deviceName],
|
|
|
@"device_token": [JDFacade facade].APNSToken ? [JDFacade facade].APNSToken : ksEmptyString,
|
|
|
- @"device_hostname": [JDFacade facade].deviceHostName ? [JDFacade facade].deviceHostName : ksEmptyString};
|
|
|
+ @"message_type": @"auth"};
|
|
|
|
|
|
- [[RequestHandler handler] sendAsyncPostRequestAPIPath:API_POST_SIGN_IN parameters:param modelClass:[LoginModel class] completion:^(id responseObject) {
|
|
|
- if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- LoginModel *loginInfo = (LoginModel *)responseObject;
|
|
|
- NSLog(@"%@", loginInfo);
|
|
|
-
|
|
|
- if (loginInfo) {//API 성공 ,함
|
|
|
- [self actionForLoginSucceed:loginInfo];
|
|
|
-
|
|
|
- }
|
|
|
- } failure:^(id errorObject) {
|
|
|
- JDErrorModel *error = (JDErrorModel *)errorObject;
|
|
|
-
|
|
|
- if ([error.errorCode isEqualToString:API_RESPONSE_UNAUTHORIZED_EMAIL]) {//이메일 아이디 인증이 안 된 계정
|
|
|
- [self actionForWaiting];
|
|
|
- } else if ([error.errorCode isEqualToString:API_RESPONSE_UNAUTHORIZED_DEVICE]) {//새로운 단말 인증 필요
|
|
|
- [self actionForNeedsRegisteringNewDevice:error.nickname];
|
|
|
- } else if ([error.errorCode isEqualToString:API_RESPONSE_MOBILES_OVER]) {//단말 초과
|
|
|
- [self actionForMobilesOver:error.deviceList];
|
|
|
- } else {
|
|
|
- [[JDFacade facade] alert:error.errorMessage];
|
|
|
- }
|
|
|
- }];
|
|
|
+ [[SocketServiceHandler sharedManager] sendData:param];
|
|
|
+
|
|
|
+// [[RequestHandler handler] sendAsyncPostRequestAPIPath:API_POST_SIGN_IN parameters:param modelClass:[LoginModel class] completion:^(id responseObject) {
|
|
|
+// if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
|
|
|
+// return;
|
|
|
+// }
|
|
|
+//
|
|
|
+// LoginModel *loginInfo = (LoginModel *)responseObject;
|
|
|
+// NSLog(@"%@", loginInfo);
|
|
|
+//
|
|
|
+// if (loginInfo) {//API 성공 ,함
|
|
|
+// [self actionForLoginSucceed:loginInfo];
|
|
|
+//
|
|
|
+// }
|
|
|
+// } failure:^(id errorObject) {
|
|
|
+// JDErrorModel *error = (JDErrorModel *)errorObject;
|
|
|
+//
|
|
|
+// if ([error.errorCode isEqualToString:API_RESPONSE_UNAUTHORIZED_EMAIL]) {//이메일 아이디 인증이 안 된 계정
|
|
|
+// [self actionForWaiting];
|
|
|
+// } else if ([error.errorCode isEqualToString:API_RESPONSE_UNAUTHORIZED_DEVICE]) {//새로운 단말 인증 필요
|
|
|
+// [self actionForNeedsRegisteringNewDevice:error.nickname];
|
|
|
+// } else if ([error.errorCode isEqualToString:API_RESPONSE_MOBILES_OVER]) {//단말 초과
|
|
|
+// [self actionForMobilesOver:error.deviceList];
|
|
|
+// } else {
|
|
|
+// [[JDFacade facade] alert:error.errorMessage];
|
|
|
+// }
|
|
|
+// }];
|
|
|
}
|
|
|
|
|
|
//자동로그인 요청
|
|
|
@@ -329,28 +331,20 @@
|
|
|
#pragma mark - UI Events
|
|
|
- (IBAction)btnLogInTouched:(id)sender {
|
|
|
|
|
|
-// CustomAlertView *alert = [[CustomAlertView alloc] initWithTitle:@"알림" message:@"테스트 메세지" delegate:nil OKButtonTitle:@"예" cancelButtonTitle:@"아니오"];
|
|
|
-// [alert showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
|
|
|
-// if (buttonIndex == 0) {//OK - 이전화면으로
|
|
|
-//
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// }];
|
|
|
-//
|
|
|
-// return;
|
|
|
#ifdef DEBUG_MODE
|
|
|
if ([_txtEmail.text isEmptyString]) {
|
|
|
- _txtEmail.text = @"asura77@ncomz.com";
|
|
|
+ _txtEmail.text = @"asura77";
|
|
|
}
|
|
|
|
|
|
if ([_txtPasswd.text isEmptyString]) {
|
|
|
- _txtPasswd.text = @"";
|
|
|
+ _txtPasswd.text = @"09767955";
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
- if (![ValidateUtil validateTextfiled:_txtEmail type:ValidateTypeEmail title:@"이메일" ]) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ // TODO : 아이디 형식 검사할것
|
|
|
+// if (![ValidateUtil validateTextfiled:_txtEmail type:ValidateTypeEmail title:@"이메일" ]) {
|
|
|
+// return;
|
|
|
+// }
|
|
|
|
|
|
if (![ValidateUtil validateTextfiled:_txtEmail type:ValidateTypeNull title:@"비밀번호" ]) {
|
|
|
return;
|