zoukankan      html  css  js  c++  java
  • 注册

            __weak typeof(self) weakSelf=self;

            

            NSUserDefaults *use = [NSUserDefaults standardUserDefaults];

            NSLog(@"%@",[use valueForKey:@"clientId"]);

            

            AFHTTPRequestOperationManager *manager=[AFHTTPRequestOperationManager manager];

            

            NSURL *url = [NSURL URLWithString:@"服务器"];

            NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];

            [request setHTTPMethod:@"POST"];

             NSString *bodyStr = [NSString stringWithFormat:@"verify=%@&phone=%@&password=%@&password2=%@&recommend=@""",_TextCode.text,_phoneNumbertextfield.text,_passwordTextField.text,_againTextField.text];

            //clientid=%@

            bodyStr=[bodyStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

            NSLog(@"%@",kSid);

            [request setHTTPBody:[bodyStr dataUsingEncoding:NSUTF8StringEncoding]];

            manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];

            

            NSOperation *operation = [manager HTTPRequestOperationWithRequest:request success:^(AFHTTPRequestOperation *operation, id responseObject) {

                NSLog(@"开始打印%@",responseObject);

                if ([responseObject[@"code"]isEqualToString:@"100"]) {

                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"注册成功,请登录!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];

                    [alert show];

                    [self.navigationController popViewControllerAnimated:YES];

                    

                }else if([responseObject[@"code"]isEqualToString:@"101"]){

                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"该手机号已注册" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];

                    [alert show];

                }

                //[responseObject[@"code"]isEqualToString:@"100"]

                

            } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

                

                NSLog(@"Error: %@", error);

            }];

            [manager.operationQueue addOperation:operation];

  • 相关阅读:
    EBS 获取用户密码
    Using Create directory & UTL_FILE in Oracle
    Loops with PL/SQL
    Create trigger
    Oracle DB解锁和 rerun FA depreciation
    oracle中数组的运用
    FNDLOAD使用大全
    不安装Oracle客户端,透过PL/SQL Developer连接Server DB
    R12组织屏蔽
    Oracle DB Link创建
  • 原文地址:https://www.cnblogs.com/-ios/p/4669656.html
Copyright © 2011-2022 走看看