|
|
@@ -28,6 +28,14 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+#pragma mark --- 保存账号密码进沙盒
|
|
|
+-(void)saveUserDataToNSUserDefaults
|
|
|
+{
|
|
|
+ [[NSUserDefaults standardUserDefaults] setObject:FORMAT(@"%@",_phoneTF.text) forKey:@"userAccount"];
|
|
|
+
|
|
|
+ [[NSUserDefaults standardUserDefaults] setObject:FORMAT(@"%@",_passwordTF.text) forKey:@"userPassword"];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark --- 登录操作
|
|
|
-(void)loginAction
|
|
|
{
|
|
|
@@ -63,6 +71,8 @@
|
|
|
|
|
|
[YRUserInfo shareManager].userInfo = resDic;
|
|
|
|
|
|
+ [self saveUserDataToNSUserDefaults];
|
|
|
+
|
|
|
/*用户绑定的企业大于1个时,提供选择公司登陆*/
|
|
|
if (response.companyArray.count > 1) {
|
|
|
|
|
|
@@ -331,7 +341,7 @@
|
|
|
[_phoneTF setValue:HexColor(@"#FFFFFF") forKeyPath:@"_placeholderLabel.textColor"];
|
|
|
[firstView addSubview:_phoneTF];
|
|
|
[_phoneTF addTarget:self action:@selector(passConTextChange:) forControlEvents:UIControlEventEditingChanged];
|
|
|
- _phoneTF.text = @"15018524229";
|
|
|
+ _phoneTF.text = u_account;
|
|
|
|
|
|
_passwordTF = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(password.frame)+14, 0, self_width-90, 50)];
|
|
|
_passwordTF.delegate = self;
|
|
|
@@ -351,7 +361,7 @@
|
|
|
[_passwordTF setValue:HexColor(@"#FFFFFF") forKeyPath:@"_placeholderLabel.textColor"];
|
|
|
[secondView addSubview:_passwordTF];
|
|
|
[_passwordTF addTarget:self action:@selector(pwdTextChanged:) forControlEvents:UIControlEventAllEditingEvents|UIControlEventValueChanged];
|
|
|
- _passwordTF.text = @"111111";
|
|
|
+ _passwordTF.text = u_password;
|
|
|
|
|
|
self.loginBtn = [[YRButton alloc]initWithTitle:@"登录" titleColor:nil titleFont:18 buttonNormalColor:nil buttonSelectColor:nil buttonDiabledColor:nil];
|
|
|
self.loginBtn.frame = CGRectMake(20, CGRectGetMaxY(secondView.frame)+25, self_width-40, 40);
|
|
|
@@ -364,8 +374,7 @@
|
|
|
[self.scrollView addSubview:registerBtn];
|
|
|
[registerBtn addTarget:self action:@selector(registerAction) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
|
- [self loginAction];
|
|
|
-
|
|
|
+// [self loginAction];
|
|
|
}
|
|
|
|
|
|
#pragma mark --- lazy
|