add
This commit is contained in:
@@ -90,7 +90,6 @@
|
||||
}
|
||||
NSLog(@" %@", _fullUrl);
|
||||
// NSMutableDictionary *postDict = [self buildRequestDict];
|
||||
|
||||
[GiGaNetManager requestMethod:self.requestMethod Url:self.fullUrl params:self.params responseBlock:^(NSDictionary *responseDict, NSDictionary *responseHeaderFields, NSError *error) {
|
||||
|
||||
[self analyseResponseInfo:responseDict headerFileds:responseHeaderFields error:error];
|
||||
|
||||
@@ -199,12 +199,7 @@
|
||||
[manager POST:fullurl parameters:parms constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
|
||||
for (NSUInteger i= 0; i < imageNames.count; i ++) {
|
||||
//上传时使用当前的系统事件作为文件名
|
||||
// NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
//
|
||||
// formatter.dateFormat = @"yyyyMMddHHmmss";
|
||||
//
|
||||
// NSString *str = [formatter stringFromDate:[NSDate date]];
|
||||
|
||||
|
||||
NSString *fileName = [NSString stringWithFormat:@"%@.png", imageNames[i]];
|
||||
//服务器上传文件的字段和类型
|
||||
|
||||
@@ -150,22 +150,38 @@
|
||||
|
||||
|
||||
NSData*imageData=UIImagePNGRepresentation(image);
|
||||
NSString *fullPath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:[NSString stringWithFormat:@"gigafeed/%@.png",imagename]];
|
||||
NSLog(@"fullPath%@",fullPath);
|
||||
[imageData writeToFile:fullPath atomically:YES];
|
||||
NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
|
||||
|
||||
NSString *savePath = nil;
|
||||
savePath = [NSString stringWithFormat:@"%@/gigafee/%@",rootPath,imagename];
|
||||
|
||||
NSFileManager *manager = [NSFileManager defaultManager];
|
||||
if(![manager fileExistsAtPath:savePath]){
|
||||
[manager createDirectoryAtPath:savePath withIntermediateDirectories:YES attributes:nil error:nil];
|
||||
}
|
||||
[imageData writeToFile:[NSString stringWithFormat:@"%@/%@.png",savePath,imagename] atomically:YES];
|
||||
|
||||
}
|
||||
|
||||
+(UIImage *)getUserFeedbackImag:(NSString *)imageName{
|
||||
NSString*fullpath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:[NSString stringWithFormat:@"gigafeed/%@.png",imageName]];
|
||||
UIImage*saveImage=[[UIImage alloc]initWithContentsOfFile:fullpath];
|
||||
NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
|
||||
|
||||
NSString *filePath = nil;
|
||||
filePath = [NSString stringWithFormat:@"%@/gigafee/%@/%@.png",rootPath,imageName,imageName];
|
||||
NSLog(@"获取Path:%@",filePath);
|
||||
UIImage *Img = [UIImage imageWithContentsOfFile:filePath];
|
||||
|
||||
return Img;
|
||||
|
||||
return saveImage;
|
||||
}
|
||||
|
||||
+(void)delectAllfeedimages{
|
||||
|
||||
NSString *fullPath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:[NSString stringWithFormat:@"gigafeed/"]];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];[fileManager removeItemAtPath:fullPath error:nil];
|
||||
NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
|
||||
|
||||
NSString *filePath = nil;
|
||||
filePath = [NSString stringWithFormat:@"%@/gigafee/",rootPath];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];[fileManager removeItemAtPath:filePath error:nil];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,11 @@ const static NSInteger GIGADB_USER_VER = 0;//当前数据库版本号
|
||||
}
|
||||
NSLog(@"user dic ***\n%@",result.dic);
|
||||
}else{
|
||||
|
||||
if (errorCodeMsg) {
|
||||
errorCodeMsg(requst.resultDict);
|
||||
}
|
||||
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user