添加注销账号
This commit is contained in:
@@ -489,6 +489,37 @@ NSString * const KBUserCharacterDeletedNotification = @"KBUserCharacterDeletedNo
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)fetchCancelAccountWarningWithCompletion:(KBCancelAccountAgreementCompletion)completion {
|
||||
KBLanguageCode langCode = [KBLocalizationManager shared].currentLanguageCode;
|
||||
NSString *locale;
|
||||
if ([langCode isEqualToString:KBLanguageCodeSimplifiedChinese]) {
|
||||
locale = @"zh-CN";
|
||||
} else {
|
||||
locale = @"en-US";
|
||||
}
|
||||
|
||||
[[KBNetworkManager shared] GET:API_CANCEL_ACCOUNT_WARNING
|
||||
parameters:@{@"locale": locale}
|
||||
headers:nil
|
||||
autoShowBusinessError:NO
|
||||
completion:^(NSDictionary *jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||
if (error) {
|
||||
if (completion) completion(nil, error);
|
||||
return;
|
||||
}
|
||||
|
||||
id dataObj = jsonOrData[KBData];
|
||||
NSString *html = @"";
|
||||
if ([dataObj isKindOfClass:[NSDictionary class]]) {
|
||||
id content = dataObj[@"content"];
|
||||
if ([content isKindOfClass:[NSString class]]) {
|
||||
html = (NSString *)content;
|
||||
}
|
||||
}
|
||||
if (completion) completion(html, nil);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
/// 清理本地登录态及关联缓存,并回到首页。
|
||||
|
||||
Reference in New Issue
Block a user