Commit d44427c0a57b64aa0b56ea639a9cd4764d993a2f
1 parent
f781f313
0.4.8修改判断网络方法
Showing
5 changed files
with
4 additions
and
9 deletions
CNLiveCMineModule.podspec
CNLiveCMineModule/Classes/CNCSubMine/View/CNMineSettingCell.m
| ... | ... | @@ -7,7 +7,6 @@ |
| 7 | 7 | |
| 8 | 8 | #import "CNMineSettingCell.h" |
| 9 | 9 | |
| 10 | -#define CNConnectSuccNotification @"CNConnectSuccNotification" | |
| 11 | 10 | @interface CNMineSettingCell () |
| 12 | 11 | @property (nonatomic, strong) UILabel *titleLab; |
| 13 | 12 | @property (nonatomic, strong) UIImageView *titleImg; |
| ... | ... | @@ -279,7 +278,7 @@ |
| 279 | 278 | - (void)switchAction:(UISwitch *)sender { |
| 280 | 279 | if (_model.cellType == SettingCellTypeSee) { //42 是否允许陌生人看生活圈 |
| 281 | 280 | sender.userInteractionEnabled = NO; |
| 282 | - if (![[[NSUserDefaults standardUserDefaults] objectForKey:CNConnectSuccNotification] boolValue]) { | |
| 281 | + if (![CNLiveBusinessTools connectedToNetwork]) { | |
| 283 | 282 | [sender setOn:[_model.status isEqualToString:@"access"]]; |
| 284 | 283 | sender.userInteractionEnabled = YES; |
| 285 | 284 | return; | ... | ... |
CNLiveCMineModule/Classes/CNCSubMine/ViewController/CNMineCodeVC.m
| ... | ... | @@ -7,7 +7,6 @@ |
| 7 | 7 | |
| 8 | 8 | #import "CNMineCodeVC.h" |
| 9 | 9 | |
| 10 | -#define CNConnectSuccNotification @"CNConnectSuccNotification" | |
| 11 | 10 | #define kDefaultPicIcon(width) [UIImage qmui_imageWithColor:[UIColor qmui_colorWithHexString:@"#f2f2f2"] size:CGSizeMake(width, width) cornerRadius:0] |
| 12 | 11 | #define OrderIdKey @"OrderIdKey" //订单号 |
| 13 | 12 | @interface CNMineCodeVC () |
| ... | ... | @@ -263,7 +262,7 @@ |
| 263 | 262 | action1.buttonAttributes = cancelTitleAttributs; |
| 264 | 263 | [alertController showWithAnimated:YES]; |
| 265 | 264 | } else if (status == PHAuthorizationStatusAuthorized) { // 用户允许访问相册 |
| 266 | - if (![[[NSUserDefaults standardUserDefaults] objectForKey:CNConnectSuccNotification] boolValue]) { | |
| 265 | + if (![CNLiveBusinessTools connectedToNetwork]) { | |
| 267 | 266 | [QMUITips showError:@"网络不给力" inView:AppKeyWindow hideAfterDelay:1.5]; |
| 268 | 267 | return; |
| 269 | 268 | }; | ... | ... |
CNLiveCMineModule/Classes/CNLiveCMineHeader.h
| ... | ... | @@ -20,9 +20,6 @@ |
| 20 | 20 | #define kCNLiveDefaultUserCircleIcon [UIImage cnlive_imageWithColor:[UIColor grayColor] size:CGSizeMake(60, 60) cornerRadius:0] |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | -#ifndef CNConnectSuccNotification | |
| 24 | -#define CNConnectSuccNotification @"CNConnectSuccNotification" | |
| 25 | -#endif | |
| 26 | 23 | #ifndef CNWjjUserTermsUrls |
| 27 | 24 | #define CNWjjUserTermsUrls @"CNWjjUserTermsUrls" |
| 28 | 25 | #endif | ... | ... |
CNLiveCMineModule/Classes/CNPrivacy/View/CNPrivacyTableViewCell.m
| ... | ... | @@ -82,7 +82,7 @@ |
| 82 | 82 | - (void)switchAction:(UISwitch *)sender { |
| 83 | 83 | if (_model.cellType == CNPrivacyCellTypeSee) { //1 是否允许陌生人看生活圈 |
| 84 | 84 | sender.userInteractionEnabled = NO; |
| 85 | - if (![[[NSUserDefaults standardUserDefaults] objectForKey:CNConnectSuccNotification] boolValue]) { | |
| 85 | + if (![CNLiveBusinessTools connectedToNetwork]) { | |
| 86 | 86 | [sender setOn:[_model.status isEqualToString:@"access"]]; |
| 87 | 87 | sender.userInteractionEnabled = YES; |
| 88 | 88 | return; | ... | ... |