From 78e372b039c0c7e49d6ed032e27fed2fe463ebc1 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 20 May 2024 16:10:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/Api/MOP_registerExtensionApi.m | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/ios/Classes/Api/MOP_registerExtensionApi.m b/ios/Classes/Api/MOP_registerExtensionApi.m index cd50fbc..9b27607 100644 --- a/ios/Classes/Api/MOP_registerExtensionApi.m +++ b/ios/Classes/Api/MOP_registerExtensionApi.m @@ -29,22 +29,16 @@ return; } // 再判断回调是否为失败 -// BOOL hasError = [[result allKeys] containsObject:@"errMsg"]; -// if (hasError) { -// NSString *errMsg = result[@"errMsg"]; -// NSString *errPrefix = [NSString stringWithFormat:@"%@:fail", name]; -// BOOL isFail = [errMsg hasPrefix:errPrefix]; -// if (isFail) { -// NSLog(@"extensionApi reslut:fail"); -// callback(FATExtensionCodeFailure,nil); -// return; -// } -// } - - BOOL hasError = [[result allKeys] containsObject:@"phizErr"]; + BOOL hasError = [[result allKeys] containsObject:@"errMsg"]; if (hasError) { - callback(FATExtensionCodeFailure,result[@"phizErr"]); - return; + NSString *errMsg = result[@"errMsg"]; + NSString *errPrefix = [NSString stringWithFormat:@"%@:fail", name]; + BOOL isFail = [errMsg hasPrefix:errPrefix]; + if (isFail) { + NSLog(@"extensionApi reslut:fail"); + callback(FATExtensionCodeFailure,nil); + return; + } } // 其他的按成功处理 NSLog(@"extensionApi callback:%@",result);