Commit f877d8f2 by lee

u

parent 4a6dc266
......@@ -375,10 +375,10 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
[manager setTaskWillPerformHTTPRedirectionBlock:^NSURLRequest * _Nonnull(NSURLSession * _Nonnull session, NSURLSessionTask * _Nonnull task, NSURLResponse * _Nonnull response, NSURLRequest * _Nonnull request) {
NSString *url = request.URL.absoluteString;
if ([url isEqualToString:[NSString stringWithFormat:@"https://%@/account",Shopify_SHOP_DOMAIN]]) {
success();
if(success) success();
}else{
NSError *error = [[NSError alloc] initWithDomain:url code:401 userInfo:@{NSLocalizedDescriptionKey:@"email & password is invalid !"}];
failure(error);
if(failure) failure(error);
}
return nil;
}];
......@@ -391,7 +391,7 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
};
[manager POST:loginUrl parameters:param success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
failure(error);
if(failure) failure(error);
}];
}
......
......@@ -26,7 +26,7 @@
@implementation KWMHomeVC
+(NSString *)kwmTag{
+ (NSString *)kwmTag{
return @"KWMHomeVC";
}
......@@ -43,13 +43,7 @@
[super viewDidLoad];
_dataArr = [NSArray array];
[self requestBlogAPI];
[self.api loginWebSuccess:^{
// [[KWMShoppingCart sharedInstance] allItemsWithCallback:^(NSError *error, KWMCartResult *cart) {
//
// }];
} failure:^(NSError *error) {
}];
[self.api loginWebSuccess:nil failure:nil];
}
- (UITableView *)targetTableView{
......
......@@ -192,6 +192,7 @@
//异步保存数据
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self.api loginWebSuccess:nil failure:nil];
[self saveData];
});
// NSString *path = NSHomeDirectory();
......
......@@ -441,6 +441,7 @@
NSLog(@"登录成功");
//异步保存数据
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self.api loginWebSuccess:nil failure:nil];
[self saveData];
});
[self dismissViewControllerAnimated:YES completion:nil];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment