1 parent d5436d4 commit 338d1dbCopy full SHA for 338d1db
1 file changed
Coding_iOS/Ease_2FA/Controllers/OTPListViewController.m
@@ -186,8 +186,10 @@ - (void)beginButtonClicked:(id)sender{
186
}
187
188
- (void)addOneAuthURL:(OTPAuthURL *)authURL{
189
+ BOOL alreadyHave = NO;
190
for (OTPAuthURL *item in self.authURLs) {
191
if ([authURL.name isEqualToString:item.name]) {
192
+ alreadyHave = YES;
193
if ([authURL.otpCode isEqualToString:item.otpCode]) {
194
kTipAlert(@"该二维码已被保存为账户名:%@", authURL.name);
195
}else{
@@ -211,6 +213,12 @@ - (void)addOneAuthURL:(OTPAuthURL *)authURL{
211
213
break;
212
214
215
216
+ if (!alreadyHave) {
217
+ [authURL saveToKeychain];
218
+ [self.authURLs addObject:authURL];
219
+ [self configUI];
220
+ kTipAlert(@"添加账户成功:%@", authURL.name);
221
+ }
222
223
224
- (void)deleteOneAuthURL:(OTPAuthURL *)authURL{
0 commit comments