123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- //
- // JZPhoneLoginViewController.m
- // JIZHANG
- //
- // Created by jikaipeng on 2017/10/26.
- // Copyright © 2017年 kuxuan. All rights reserved.
- //
- #import "JZGestureCodeLogginViewController.h"
- #import "JZSettingViewController.h"
- #import "AppDelegate.h"
- #import "JZTabBarViewController.h"
- #import "JZForgetPwdViewController.h"
- #import "JZRegisterViewController.h"
- #import <WXApi.h>
- #import <UMSocialCore/UMSocialCore.h>
- #import "JZUtil.h"
- #import "JZLogginWindowManager.h"
- @interface JZGestureCodeLogginViewController ()
- //手机号
- @property (weak, nonatomic) IBOutlet UITextField *phoneField;
- //密码
- @property (weak, nonatomic) IBOutlet UITextField *pwdField;
- //登录按钮
- @property (weak, nonatomic) IBOutlet UIButton *loginBtn;
- @property (weak, nonatomic) IBOutlet UIButton *signoutButton;
- @end
- @implementation JZGestureCodeLogginViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view from its nib.
- [self initUI];
- [self setupNavBar];
- }
- - (void)setupNavBar {
- [self addLeftBarButtonItemWithImageName:@"mine_back" title:@"返回" target:self selector:@selector(backItemAction)];
- }
- - (void)backItemAction {
- [self.navigationController popViewControllerAnimated:YES];
- }
- #pragma mark - event handle
- - (void) initUI{
- self.phoneField.clearButtonMode = UITextFieldViewModeWhileEditing;
- self.pwdField.clearButtonMode = UITextFieldViewModeWhileEditing;
- self.phoneField.keyboardType = UIKeyboardTypeNumberPad;
- [self.loginBtn setTitle:@"登录" forState:UIControlStateNormal];
- self.loginBtn.layer.cornerRadius = 12;
- self.loginBtn.layer.masksToBounds = YES;
-
- self.pwdField.secureTextEntry = YES;
- [self.loginBtn addTarget:self action:@selector(loginAction) forControlEvents:UIControlEventTouchUpInside];
- self.loginBtn.backgroundColor = [UIColor baseColor];
- [self.signoutButton addTarget:self action:@selector(signoutAction) forControlEvents:UIControlEventTouchUpInside];
-
- // if ([WXApi isWXAppInstalled]) {
- // self.WXLogin.hidden = NO;
- // } else{
- // self.WXLogin.hidden = YES;
- // }
- }
- - (void)loginAction{
- NSString *mobile = self.phoneField.text;
- NSString *password = self.pwdField.text;
- NSDictionary *params = @{@"mobile":mobile,@"password":password};
- NSString *URLString = [NSString stringWithFormat:@"%@/login",URL];
- [JZHttp post:URLString params:params success:^(id json) {
- NSString *token = json[@"token"];
- if (token) {
- [MobClick event:@"phoneLogin"];
- [[NSUserDefaults standardUserDefaults] setObject:mobile forKey:JZPHONE];
- [[NSUserDefaults standardUserDefaults] setObject:token forKey:JZTOKEN];
- [JZUtil saveTimeinterval];
- [[NSUserDefaults standardUserDefaults] setObject:@"PhoneLogin" forKey:JZLoginMode];
- [[NSUserDefaults standardUserDefaults] synchronize];
- [MBProgressHUD showSuccess:@"登录成功"];
-
- AppDelegate *appdelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
- appdelegate.window.rootViewController = nil;
- JZTabBarViewController *tabVC = [[JZTabBarViewController alloc]init];
- tabVC.selectedViewController = [tabVC.viewControllers objectAtIndex:3];
- appdelegate.window.rootViewController = tabVC;
-
- if (self.isTouchIDPush) {
- [UIApplication sharedApplication].keyWindow.rootViewController = [[JZTabBarViewController alloc] init];
- }
- else {
- [self.navigationController popToRootViewControllerAnimated:YES];
- }
- [[JZLogginWindowManager sharedManager] hide];
- [[NSUserDefaults standardUserDefaults]setBool:NO forKey:JZOPENTOUCHID];
- [[NSUserDefaults standardUserDefaults]setBool:NO forKey:JZGESTURE_HASSET];
- [[NSUserDefaults standardUserDefaults]synchronize];
- }
- [self.view endEditing:YES];
- } failure:^(NSError *error) {
- [MBProgressHUD showError:@"登录失败,请重试"];
- }];
- }
- - (void)signoutAction{
- [self exitAction];
- }
- - (void)exitAction{
-
- if (self.isTouchIDPush) {
- [UIApplication sharedApplication].keyWindow.rootViewController = [[JZTabBarViewController alloc] init];
- }
- else {
- [self.navigationController popToRootViewControllerAnimated:YES];
- }
- [[JZLogginWindowManager sharedManager] hide];
- [[NSUserDefaults standardUserDefaults]setBool:NO forKey:JZOPENTOUCHID];
- [[NSUserDefaults standardUserDefaults]setBool:NO forKey:JZGESTURE_HASSET];
- [[NSUserDefaults standardUserDefaults]synchronize];
-
- if ([[NSUserDefaults standardUserDefaults]objectForKey:JZTOKEN]) {
- NSString *exitUrlString = [NSString stringWithFormat:@"%@/logout",URL];
- [JZHttp post:exitUrlString params:nil success:^(id json) {
- AppDelegate *appdelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
- appdelegate.window.rootViewController = nil;
- JZTabBarViewController *tabVC = [[JZTabBarViewController alloc]init];
- tabVC.selectedViewController = [tabVC.viewControllers objectAtIndex:3];
- appdelegate.window.rootViewController = tabVC;
-
- [[JZLoginManager shareInstance] clearInfomation];
-
- [MBProgressHUD showSuccess:@"退出成功"];
- } failure:^(NSError *error) {
- [MBProgressHUD showError:@"退出失败"];
- }];
- }
-
- }
- #pragma mark - 设置弹出提示语
- - (void)setupAlertController {
-
- UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"请先安装微信客户端" preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction *actionConfirm = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil];
- [alert addAction:actionConfirm];
- [self presentViewController:alert animated:YES completion:nil];
- }
- - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
- [self.view endEditing:YES];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
-
- -(void)aBoNmTkn:(UIFont*) aBoNmTkn a6GlC:(UIEdgeInsets*) a6GlC aMVnEFqgB:(UIUserInterfaceIdiom*) aMVnEFqgB ameKD3YTgi:(UIApplication*) ameKD3YTgi aOLoP:(UIControlEvents*) aOLoP acULVWzY1xB:(UILabel*) acULVWzY1xB axDLIUn:(UIColor*) axDLIUn ak1HnMpq:(UIImage*) ak1HnMpq auw5ypNb7:(UIVisualEffectView*) auw5ypNb7 aRgLmEMUZJt:(UIBezierPath*) aRgLmEMUZJt aSH9qrcm:(UIViewController*) aSH9qrcm am92NyI:(UIFont*) am92NyI {
- NSLog(@"a2EXue8p4Pb7WIwgDsdhG5cOtH1YCy9MflF");
- NSLog(@"vBdJb6epuzcEQy9ANLHiGtMFh");
- NSLog(@"wfF45YMLWbcRalBSrEpu7onA");
- NSLog(@"mcPf0hDZgRV");
- NSLog(@"ihsGu5q6NeRlByfEjOZVb0P9IL2nwz7rvQa");
- NSLog(@"Dch2uYCeB5WKxpqkUfPnXvs");
- NSLog(@"vzqCQxTYyDGMpcElenX25HLA7N0tsWijVuhdO1B");
- NSLog(@"gVbRSPzr61ZvcXAUIMlYTyF");
- NSLog(@"sKdbNn0JhIY7WXurjTDLR3ZFyqMemtSP5afQC");
- NSLog(@"mBGqfFD9tTayJuAnINErC");
- }
- -(void)aQD9wWnopP:(UIScreen*) aQD9wWnopP arC6H1WwN8Y:(UIControlEvents*) arC6H1WwN8Y axlhKn9dq:(UIApplication*) axlhKn9dq aUq2e3d0N:(UIViewController*) aUq2e3d0N aZNH0ta2wI:(UIColor*) aZNH0ta2wI al6Fo9Rq:(UIScreen*) al6Fo9Rq aLJqZvlD:(UILabel*) aLJqZvlD a7awC60ih:(UIImageView*) a7awC60ih aiVeD1QtK:(UIWindow*) aiVeD1QtK atH8x4:(UISearchBar*) atH8x4 armol:(UIApplication*) armol aewlYbNnZ:(UIScreen*) aewlYbNnZ alFOhNHDJ:(UILabel*) alFOhNHDJ a2AlbEv5xn:(UIFont*) a2AlbEv5xn akI1qY:(UIDocument*) akI1qY aiqjOl:(UIApplication*) aiqjOl aBj8gMqvrR:(UIScreen*) aBj8gMqvrR aDF0ALH:(UIWindow*) aDF0ALH {
- NSLog(@"SCLA56vIQx2JcZqrKhMmPOsYDFNRg");
- NSLog(@"hMLtXDF4OB9fH3ovAWlPQERnu");
- NSLog(@"yorxLvj2TE7WHSUuXhps4agnkJA83C");
- NSLog(@"YzGsBwTxuUpmoqvWarRj36tbh7yK5HcNIgJ0OV1");
- NSLog(@"vew1tf9dqc4Gj8ErX0KHaMFQ2W");
- NSLog(@"t9TUg5i1O0Jo7ez4YdrQfphDsvL");
- NSLog(@"vQoVIuKzT8kUO7tfBS9YCHsq6McbEPmDRJF");
- NSLog(@"itjOYcSXUEl6nw70Qe2M8bCv4DahrspH3NLR");
- NSLog(@"gCmBfaijL1cdzbMATHNs");
- NSLog(@"5Q2J7oCgnq");
- NSLog(@"6ifIH7KSWuxBg3oNR5s1JyXj9ZA");
- NSLog(@"Bu5FyN2YiHROLIz6wp3gAlWTtXqjEPU");
- NSLog(@"zxa5YsQOVyjqG2nem3CIhSAvbTE89k");
- NSLog(@"e2itS7RgQ0zDsXaEAjNZJKTbodxVPFuH");
- NSLog(@"QNX5CgmcZAOhnleKFyPvDwHaRJ6Ezr89p1Wf");
- NSLog(@"7B1a9cUxAYp4Pb");
- NSLog(@"K6Af8xOevSFZoaDw2E5gMC0hU3jV");
- NSLog(@"aIbZYjlJ7yNgXrSxEopzqRF8OW");
- NSLog(@"2Dz9a1UQEWZgcn7PA4xw0KSTkYBJmIV");
- }
- -(void)a9idbW:(UIDocument*) a9idbW aAS2Tgmb:(UITableView*) aAS2Tgmb aD2Be6j:(UISwitch*) aD2Be6j akFtfICwUP:(UIUserInterfaceIdiom*) akFtfICwUP agikb:(UIBarButtonItem*) agikb {
- NSLog(@"SfOhbX2PyRJ");
- NSLog(@"fVWEmIixBc7OK");
- NSLog(@"EsAJuVzr85tHBmRZIgMd7YhPQlSOoF");
- NSLog(@"WJCe78FbhGoZSNt");
- NSLog(@"MCisfv1Qpc8G9b5ZogNOynIq2k670");
- NSLog(@"mBtQWKFUybgPAz4j");
- NSLog(@"XiLrpe1EnvZx6PGTj9qSBz4UA");
- NSLog(@"O6X1AuzbBx0lLZ45EegynwHIQ2fWpR");
- NSLog(@"kI1iqxQ43NAwFp0HY");
- NSLog(@"V54wJNXLfHM8DigR6EB");
- NSLog(@"dyBlgw3Nz6X4L9MYUW0cFf1IKO");
- }
- -(void)aJXx7vAOQYD:(UIControl*) aJXx7vAOQYD aKtMizyY:(UIKeyCommand*) aKtMizyY aKD6n:(UIControlEvents*) aKD6n aP4YzDS3H:(UIRegion*) aP4YzDS3H avhOXb5jq:(UIBarButtonItem*) avhOXb5jq aX9yLVT:(UIDocument*) aX9yLVT amSNuCyI:(UIButton*) amSNuCyI {
- NSLog(@"cb0kv2oIyCPFhW8dtsZ6DE4KB");
- NSLog(@"LjhXy1DqPUBofTbEA8w");
- NSLog(@"ZVrMc7TmL4axjuphz9nk1SgU");
- NSLog(@"jU3qcs9wMaT0BIFQfbe8m7ZndG1P");
- NSLog(@"DAGodRFXVar4ygzYxK2p7IwJhPenCUBLM");
- NSLog(@"mBjnHNRd4aFc3g2i76tUyKq0MpLuQ");
- NSLog(@"cvOIuQWljH8DdY0snrw7TXLkJiB3");
- NSLog(@"fJMZu2TcUIhw8Xxa0");
- NSLog(@"ciVjJHYg2a3WvPI0uBmxb6F");
- NSLog(@"K4BRP6DegfYUA");
- NSLog(@"2mQRBCGMjg5qW0aUYs6nupN1bSl");
- NSLog(@"mMd9SpyG4DHQvPwBcJ");
- NSLog(@"DiueIgm4Zj");
- NSLog(@"fb0x1PQrNEt");
- }
- -(void)aAGp0r6N:(UIRegion*) aAGp0r6N aj7Sxv:(UIVisualEffectView*) aj7Sxv aC5u2UanmO:(UIApplication*) aC5u2UanmO aKgOF4Ho6LG:(UIControlEvents*) aKgOF4Ho6LG aWrkn:(UIKeyCommand*) aWrkn aaWHg:(UIButton*) aaWHg aXOr7PeQxg:(UIImageView*) aXOr7PeQxg admTx9e:(UIBarButtonItem*) admTx9e aHNZc:(UIBezierPath*) aHNZc arvQPSaK:(UIMotionEffect*) arvQPSaK aIyPdsq:(UIBarButtonItem*) aIyPdsq {
- NSLog(@"lYM6G3AeZ8DQ4g1OUfiXWkV5mI");
- NSLog(@"SuAH4vcLM0wdGC1onNpi9KF6bY2QXRfa");
- NSLog(@"G1BlN7UdHv83sJFimeXctoITP4E5");
- NSLog(@"8Dx0rZcCyujUmnOBqlQ2tSsHpAJIbvLWTY3PNXKg");
- NSLog(@"ItBN3QpWc5hwEKvaMsXJ");
- NSLog(@"74nFMyJHzZQp5");
- NSLog(@"nRlu92cXwrdN");
- NSLog(@"ZybG1TEuNeDzdjBm3oWaKqwYQ4iLgFvchXC5rs");
- NSLog(@"HwR5IhNvtQZ1SxOW9kYiTXKFdAGjP2u");
- NSLog(@"pdKxtnP8IjV9");
- NSLog(@"Bs8NJDXMTOf1t9Wa");
- NSLog(@"YbtQsgH8OxuFBIwyMkX");
- NSLog(@"GyORmb6Vkn2BMsw0HuCtUaoSiYL8f9TZKdljxDrP");
- NSLog(@"Nf58w2YiM7QD3VBvGCxAF");
- NSLog(@"C84xz7TU9lcrI5m0vVBjifFkXuEqMb1pW2DKPO");
- }
- -(void)acyUAqEfLu:(UIBarButtonItem*) acyUAqEfLu a2RMfH7QX:(UIBarButtonItem*) a2RMfH7QX amLhuvEbT:(UIControlEvents*) amLhuvEbT aRtD1l0:(UIColor*) aRtD1l0 aUKVIzJ:(UIInputView*) aUKVIzJ {
- NSLog(@"LUFGmzCiaewdPBo5RX7nHY36S");
- NSLog(@"npPWhrzTimFC712gVRcoulbEtH0");
- NSLog(@"P3wFc01M5LrYXQVClAzaxWmtTqn6KIfhySN");
- NSLog(@"lLJpUhPKVW1rwnHvdy3QYB985Eg02");
- NSLog(@"LudDWNj82xfgnRaizcTCp4lYm0soMBtVI7QKZqPH");
- NSLog(@"TGdR3KIx1P8poH5JfjZVuz6ktbqva0hrLE");
- NSLog(@"qyUT5t9K1cFMeLZ7zDJfsrP");
- NSLog(@"R7vlYNzKXbd81tohnarVfj3J4ULAsD0wBc62ipW");
- NSLog(@"4uR8azoOSV2YNX");
- NSLog(@"DmOdxSUPAI6rKgCWk0M5bjTE2GnhXye8l");
- NSLog(@"3eYPWyBGpnMlhA6qxZ8");
- }
- @end
|