File tree Expand file tree Collapse file tree
Coding_iOS/Ease_2FA/Controllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,12 +200,16 @@ - (void)addOneAuthURL:(OTPAuthURL *)authURL{
200200 alertV.bk_didDismissBlock = ^(UIAlertView *alertView, NSInteger buttonIndex){
201201 if (buttonIndex == 1 ) {
202202 @strongify (self);
203- [authURL saveToKeychain ];
204- if ([self .authURLs indexOfObject: item] != NSNotFound ) {
205- [self .authURLs replaceObjectAtIndex: [self .authURLs indexOfObject: item] withObject: authURL];
206- [self configUI ];
207- [self showHudTipStr: @" 更新成功" ];
203+ if ([authURL saveToKeychain ]) {
204+ if ([self .authURLs indexOfObject: item] != NSNotFound ) {
205+ [self .authURLs replaceObjectAtIndex: [self .authURLs indexOfObject: item] withObject: authURL];
206+ [self configUI ];
207+ [self showHudTipStr: @" 更新成功" ];
208+ }
209+ }else {
210+ kTipAlert (@" 保存过程中发生了异常,请重新扫描" );
208211 }
212+
209213 }
210214 };
211215 [alertV show ];
@@ -214,10 +218,13 @@ - (void)addOneAuthURL:(OTPAuthURL *)authURL{
214218 }
215219 }
216220 if (!alreadyHave) {
217- [authURL saveToKeychain ];
218- [self .authURLs addObject: authURL];
219- [self configUI ];
220- kTipAlert (@" 添加账户成功:\n %@ " , authURL.name );
221+ if ([authURL saveToKeychain ]) {
222+ [self .authURLs addObject: authURL];
223+ [self configUI ];
224+ kTipAlert (@" 添加账户成功:\n %@ " , authURL.name );
225+ }else {
226+ kTipAlert (@" 保存过程中发生了异常,请重新扫描" );
227+ }
221228 }
222229}
223230
You can’t perform that action at this time.
0 commit comments