修复了一些异常toast的问题
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
// 是否在证书域字段中验证域名
|
||||
[manager.securityPolicy setValidatesDomainName:NO];
|
||||
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/html",@"text/plain",@"image/jpeg",@"image/png", nil];
|
||||
manager.requestSerializer.timeoutInterval = 40;
|
||||
manager.requestSerializer.timeoutInterval = 60;
|
||||
});
|
||||
return manager;
|
||||
}
|
||||
@@ -219,12 +219,11 @@
|
||||
if (response && response.statusCode == 401) {
|
||||
failure(response.statusCode, @"登录已过期。");
|
||||
} else {
|
||||
if (error.code == -1009) {
|
||||
failure(error.code, @"网络异常,请检查网络后重试。");
|
||||
} else if (error.code == -1001) {
|
||||
failure(error.code, @"请求超时,请稍后再试。");
|
||||
|
||||
if (error.code == -1009 || error.code == -1001 || error.code == -1004 || error.code == -1003 || error.code == -1002 || error.code == 3840) {
|
||||
failure(error.code, @"");
|
||||
} else {
|
||||
failure(error.code, @"服务器正忙,请稍后重试。");
|
||||
failure(error.code, error.localizedDescription.length > 0 ? error.localizedDescription : @"大鹅开小差中~请稍后再试");
|
||||
}
|
||||
NSString * code = error.code ? [NSString stringWithFormat:@"%ld", error.code] : @"9999";
|
||||
NSString * des = error.description.length > 0 ? error.description : @"接口报错信息未知";
|
||||
|
Reference in New Issue
Block a user