HTTP请求code401是未授权
但是安卓可以拿到后台返回的code用这个code去跳转登录网页打开也是可以的
原因是未授权AF框架会自动走failed所以拿不到后台返回的code
解决办法!!!!
只能在failed里面做操作了
if ([error.userInfo[@"NSLocalizedDescription"] isEqualToString:@"Request failed: unauthorized (401)"]) {
//跳转登录
[SVProgressHUD showErrorWithStatus:@"未登录"];
AppDelegate*application = (AppDelegate*)[UIApplicationsharedApplication].delegate;
[applicationpushToLoginVC];
}else{
[SVProgressHUD showErrorWithStatus:@"访问失败,请重试"];
}
failure(error);
网友评论