|
@@ -74,20 +74,51 @@
|
|
|
NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
|
|
NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
|
|
|
return resultDic;
|
|
return resultDic;
|
|
|
}
|
|
}
|
|
|
-+(NSString*)download_query : (NSMutableDictionary*) params
|
|
|
|
|
|
|
++(NSString*)download_query : (NSString*) url
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
|
|
+#ifdef FAKE_DATA
|
|
|
NSString *Path =nil;
|
|
NSString *Path =nil;
|
|
|
Path=[[NSBundle mainBundle] pathForResource:@"download_query.xls" ofType:nil];
|
|
Path=[[NSBundle mainBundle] pathForResource:@"download_query.xls" ofType:nil];
|
|
|
|
|
|
|
|
return Path;
|
|
return Path;
|
|
|
-
|
|
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// params[@"_operate"]=@"valid_upload";
|
|
// params[@"_operate"]=@"valid_upload";
|
|
|
- AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
|
|
+// AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
|
|
|
- NSData *data = [self get_json:[self get_url:URL_QUERY] parameters:params file:nil];
|
|
|
|
|
- NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
|
|
|
|
|
- return resultDic;
|
|
|
|
|
|
|
+// NSData *data=[NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60*5];
|
|
|
|
|
+
|
|
|
|
|
+ //设置请求方式为get
|
|
|
|
|
+
|
|
|
|
|
+ [request setHTTPMethod:@"GET"];
|
|
|
|
|
+
|
|
|
|
|
+ //添加用户会话id
|
|
|
|
|
+
|
|
|
|
|
+ [request addValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSHTTPURLResponse* urlResponse = nil;
|
|
|
|
|
+
|
|
|
|
|
+ NSError *error = nil;
|
|
|
|
|
+
|
|
|
|
|
+ NSData *data= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
|
|
|
|
|
+
|
|
|
|
|
+ NSString* temp = NSTemporaryDirectory();
|
|
|
|
|
+
|
|
|
|
|
+ NSString* file=[urlResponse suggestedFilename];
|
|
|
|
|
+
|
|
|
|
|
+ NSString *tempfile = [temp stringByAppendingPathComponent:file];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [data writeToFile:tempfile atomically:false];
|
|
|
|
|
+ return tempfile;
|
|
|
|
|
+// NSData *data = [self get_json:[self get_url:URL_QUERY] parameters:params file:nil];
|
|
|
|
|
+// NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
|
|
|
|
|
+// return resultDic;
|
|
|
}
|
|
}
|
|
|
+(NSDictionary*)kv_detail : (NSMutableDictionary*) params
|
|
+(NSDictionary*)kv_detail : (NSMutableDictionary*) params
|
|
|
{
|
|
{
|
|
@@ -101,7 +132,7 @@
|
|
|
|
|
|
|
|
params[ @"_action"]=@"ant_mobile";
|
|
params[ @"_action"]=@"ant_mobile";
|
|
|
params[ @"module"]=@"kv_detail";
|
|
params[ @"module"]=@"kv_detail";
|
|
|
- params[ @"_operate"]=@"getCondition";
|
|
|
|
|
|
|
+ params[ @"_operate"]=@"row_action";
|
|
|
|
|
|
|
|
// params[@"_operate"]=@"valid_upload";
|
|
// params[@"_operate"]=@"valid_upload";
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
@@ -137,7 +168,7 @@
|
|
|
// NSString* d=[AESCrypt decrypt:@"VzB4+lENfbzWX7ggHh2Os1P69l5YBzKmM51yqA37AfoKgPY8bJgdK8M4WvF+wDyOsLWP\/o8H5+bHMivQp1u8wM2QV7SYzgzPwV85QKtYWIzEgLe9T0HO69EdutWz7k1rdAT\/mftsRin0Hy5SHk7txTZT\/zPH5X+FQiExCTFm5Zus39HYvp+VxCX4+kYeymn8B63AUd3mRQyscUvDjfgU2olKR\/TP8PV3g+VQMZxpKfol3P1iOtz3XQlHZV0pM6SAf+SwT0sPfrdn6CZFfNQlrKA9QjMrnBdMeSCquSIWXnmLv6okzvnlJnT0SjvJuUeqNdBC5EZ0ACnhI0MrXVZEsq1EuM9al7oPzvU5EZbjZpmx+fSFIkMzTT8bYClTnG1bsL1MCcU4pSODDorUj8zalA==" password:@"usai2010"];
|
|
// NSString* d=[AESCrypt decrypt:@"VzB4+lENfbzWX7ggHh2Os1P69l5YBzKmM51yqA37AfoKgPY8bJgdK8M4WvF+wDyOsLWP\/o8H5+bHMivQp1u8wM2QV7SYzgzPwV85QKtYWIzEgLe9T0HO69EdutWz7k1rdAT\/mftsRin0Hy5SHk7txTZT\/zPH5X+FQiExCTFm5Zus39HYvp+VxCX4+kYeymn8B63AUd3mRQyscUvDjfgU2olKR\/TP8PV3g+VQMZxpKfol3P1iOtz3XQlHZV0pM6SAf+SwT0sPfrdn6CZFfNQlrKA9QjMrnBdMeSCquSIWXnmLv6okzvnlJnT0SjvJuUeqNdBC5EZ0ACnhI0MrXVZEsq1EuM9al7oPzvU5EZbjZpmx+fSFIkMzTT8bYClTnG1bsL1MCcU4pSODDorUj8zalA==" password:@"usai2010"];
|
|
|
params = [self prepare_addtional_params:params];
|
|
params = [self prepare_addtional_params:params];
|
|
|
|
|
|
|
|
- return [super get_json:url parameters:params file:(NSString*)file err_recorder:URL_ERR_LOG result_handler:^NSMutableDictionary *(NSMutableDictionary *jsobj) {
|
|
|
|
|
|
|
+ return [super get_json:url parameters:params file:file err_recorder:URL_ERR_LOG result_handler:^NSMutableDictionary *(NSMutableDictionary *jsobj) {
|
|
|
int result=[[jsobj valueForKey:@"result"] intValue];
|
|
int result=[[jsobj valueForKey:@"result"] intValue];
|
|
|
// UIApplication * app = [UIApplication sharedApplication];
|
|
// UIApplication * app = [UIApplication sharedApplication];
|
|
|
// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|