不多说,直接上代码
#pragma mark -- 网络请求
//验证支付密码
- (void)setPayPassword {
NSString *url = [NSString stringWithFormat:@"/sdyc/app/pay/password/valid/v1"];
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
dict[@"payPassword"] = [RSA encryptString:_passwordTextField.text publicKey:[LTools cacheForKey:user_publicKey]];
dict[@"userId"] = [LTools cacheForKey:User_id];
[[YJYRequstManager shareInstance] requestWithMethod:YJYRequstMethodPost api:url parameters:dict constructingBodyBlock:nil completion:^(NSDictionary *result) {
NSDictionary *Dic = [result objectForKey:@"meta"];
if ([[Dic objectForKey:@"success"] integerValue] == 1)
{
[MBProgressHUD hideHUDForView:self.view animated:YES];
[LTools cache:@"1" ForKey:User_isPayPassword];
//跳转回指定控制器
for (UIViewController *vc in self.navigationController.viewControllers) {
if ([vc isKindOfClass:[MLMineDetailController class]]) {
[self.navigationController popToViewController:vc animated:YES];
}
}
}
} failBlock:^(NSDictionary *result) {
NSLog(@"%@",result);
}];
}