Commit 49b8b437 authored by 艾娇平's avatar 艾娇平

拼接apiHost后,加上局部变量fullUrlString

parent a953ff89
......@@ -57,38 +57,38 @@
_beforeAction();
}
URLString = [NSString stringWithFormat:@"%@%@",self.apiHost,URLString];
NSString * fullUrlString = [NSString stringWithFormat:@"%@%@",self.apiHost,URLString];
if (method == HttpMethodGet) {
[networking GET:URLString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[networking GET:fullUrlString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[self successWithTask:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[self failureWithTask:task error:error failed:failed];
}];
}else if (method == HttpMethodPost){
[networking POST:URLString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[networking POST:fullUrlString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[self successWithTask:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[self failureWithTask:task error:error failed:failed];
}];
}else if (method == HttpMethodDelete){
[networking DELETE:URLString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[networking DELETE:fullUrlString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[self successWithTask:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[self failureWithTask:task error:error failed:failed];
}];
}else if (method == HttpMethodPatch){
[networking PATCH:URLString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[networking PATCH:fullUrlString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[self successWithTask:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[self failureWithTask:task error:error failed:failed];
}];
}else if (method == HttpMethodPut){
[networking PUT:URLString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[networking PUT:fullUrlString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[self successWithTask:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[self failureWithTask:task error:error failed:failed];
......
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