|
@@ -38,10 +38,11 @@ static addLogObject *addlog_ShareInstance = nil;
|
|
|
//1.读取日志
|
|
|
//2.上传到文件中心
|
|
|
//3.拿到key上传到盒子服务器
|
|
|
-- (void)gotoAddLogFun
|
|
|
+- (void)gotoAddLogFunBySuccess:(AddLog_Success)success
|
|
|
{
|
|
|
//HLog(@"hxd beginTime");
|
|
|
if(!_canUploadNowType){
|
|
|
+ success(@"");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -50,6 +51,7 @@ static addLogObject *addlog_ShareInstance = nil;
|
|
|
if(preSecondNum){
|
|
|
long seconds = [iTools getNowTimeStamp];
|
|
|
if(seconds - preSecondNum.longValue <= 60*60){
|
|
|
+ success(@"");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -89,6 +91,7 @@ static addLogObject *addlog_ShareInstance = nil;
|
|
|
|
|
|
if(!logData || [logData length]==0){
|
|
|
_canUploadNowType = YES;
|
|
|
+ success(@"");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -104,6 +107,7 @@ static addLogObject *addlog_ShareInstance = nil;
|
|
|
[paraDict setValue:filename forKey:@"filename"];
|
|
|
[paraDict setValue:@7 forKey:@"days"];
|
|
|
|
|
|
+ KWeakSelf
|
|
|
[[netWorkManager shareInstance] doUploadFileToFileServiceWithParams:paraDict data:logData success:^(id _Nonnull responseObject) {
|
|
|
HLog(@"%@",responseObject);
|
|
|
|
|
@@ -111,17 +115,22 @@ static addLogObject *addlog_ShareInstance = nil;
|
|
|
if(model.code == 200){
|
|
|
NSString * fileKey = model.data.fileKey;
|
|
|
if(fileKey && fileKey.length >0){
|
|
|
- [self uploadKeyToServerFunBy:fileKey];
|
|
|
+ success(fileKey);
|
|
|
+ [weakSelf markAddLogTimeFun];
|
|
|
+ //[self uploadKeyToServerFunBy:fileKey];
|
|
|
}
|
|
|
else{
|
|
|
+ success(@"");
|
|
|
self->_canUploadNowType = YES;
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
+ success(@"");
|
|
|
self->_canUploadNowType = YES;
|
|
|
}
|
|
|
|
|
|
} faild:^(NSError * _Nonnull error) {
|
|
|
+ success(@"");
|
|
|
self->_canUploadNowType = YES;
|
|
|
}];
|
|
|
|
|
@@ -130,33 +139,33 @@ static addLogObject *addlog_ShareInstance = nil;
|
|
|
}
|
|
|
|
|
|
//3.拿到key上传到盒子服务器
|
|
|
-- (void)uploadKeyToServerFunBy:(NSString*)fileKey
|
|
|
-{
|
|
|
- NSMutableDictionary *paraDict = [NSMutableDictionary new];
|
|
|
- [paraDict setValue:@"ios" forKey:@"type"];
|
|
|
-
|
|
|
- NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
|
|
|
- if(!snStr){
|
|
|
- _canUploadNowType = YES;
|
|
|
- return;
|
|
|
- }
|
|
|
- [paraDict setValue:snStr forKey:@"sn"];
|
|
|
- [paraDict setValue:fileKey forKey:@"key"];
|
|
|
-
|
|
|
- KWeakSelf
|
|
|
- [[netWorkManager shareInstance] CommonPostCallBackCode:addLogFun Parameters:paraDict success:^(id _Nonnull responseObject) {
|
|
|
- SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
- if(model.code == 0){
|
|
|
- [weakSelf markAddLogTimeFun];
|
|
|
- }
|
|
|
- else{
|
|
|
- self->_canUploadNowType = YES;
|
|
|
- }
|
|
|
-
|
|
|
- } failure:^(NSError * _Nonnull error) {
|
|
|
- self->_canUploadNowType = YES;
|
|
|
- }];
|
|
|
-}
|
|
|
+//- (void)uploadKeyToServerFunBy:(NSString*)fileKey
|
|
|
+//{
|
|
|
+// NSMutableDictionary *paraDict = [NSMutableDictionary new];
|
|
|
+// [paraDict setValue:@"ios" forKey:@"type"];
|
|
|
+//
|
|
|
+// NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
|
|
|
+// if(!snStr){
|
|
|
+// _canUploadNowType = YES;
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// [paraDict setValue:snStr forKey:@"sn"];
|
|
|
+// [paraDict setValue:fileKey forKey:@"key"];
|
|
|
+//
|
|
|
+// KWeakSelf
|
|
|
+// [[netWorkManager shareInstance] CommonPostCallBackCode:addLogFun Parameters:paraDict success:^(id _Nonnull responseObject) {
|
|
|
+// SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
+// if(model.code == 0){
|
|
|
+// [weakSelf markAddLogTimeFun];
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// self->_canUploadNowType = YES;
|
|
|
+// }
|
|
|
+//
|
|
|
+// } failure:^(NSError * _Nonnull error) {
|
|
|
+// self->_canUploadNowType = YES;
|
|
|
+// }];
|
|
|
+//}
|
|
|
|
|
|
- (void)markAddLogTimeFun
|
|
|
{
|