This commit is contained in:
2025-12-04 16:59:59 +08:00
parent f593ef0b4a
commit 8f63741d8c
5 changed files with 94 additions and 6 deletions

View File

@@ -11,6 +11,8 @@
#import "KBUser.h"
#import "KBAPI.h"
NSString * const KBUserCharacterDeletedNotification = @"KBUserCharacterDeletedNotification";
@implementation KBMyVM
- (void)fetchUserDetailWithCompletion:(KBMyUserDetailCompletion)completion {
@@ -111,7 +113,6 @@
}
NSDictionary *params = @{@"id": characterId};
[KBHUD show];
[[KBNetworkManager shared] GET:API_CHARACTER_DEL_USER_CHARACTER
parameters:params
headers:nil
@@ -119,9 +120,20 @@
completion:^(NSDictionary *jsonOrData,
NSURLResponse * _Nullable response,
NSError * _Nullable error) {
[KBHUD dismiss];
BOOL success = (error == nil);
if (success) {
// App HomeRankContentVC / HomeHotVC
NSDictionary *info = @{@"characterId": characterId ?: @0};
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:KBUserCharacterDeletedNotification
object:nil
userInfo:info];
});
}
if (completion) {
completion(error == nil, error);
completion(success, error);
}
}];
}