File tree 1 file changed +8
-1
lines changed
SCNetworkKit/Classes/Request
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,14 @@ - (NSMutableURLRequest *)_makeURLRequest:(NSString *)urlString
290
290
{
291
291
NSAssert (urlString, @" makeURLRequest:url不能为空" );
292
292
if (parameters) {
293
- NSString *queryStr = [SCNUtil makeUrlEncodeingString: parameters];
293
+ NSURLComponents *com = [[NSURLComponents alloc ] initWithString: urlString];
294
+ NSMutableDictionary *rmDuplicates = [NSMutableDictionary dictionaryWithDictionary: parameters];
295
+ for (NSURLQueryItem *item in [com queryItems ]) {
296
+ if ([rmDuplicates objectForKey: item.name]) {
297
+ [rmDuplicates removeObjectForKey: item.name];
298
+ }
299
+ }
300
+ NSString *queryStr = [SCNUtil makeUrlEncodeingString: rmDuplicates];
294
301
if (queryStr.length > 0 ) {
295
302
if (NSNotFound != [urlString rangeOfString: @" ?" ].location ) {
296
303
NSString *join = @" &" ;
You can’t perform that action at this time.
0 commit comments