Commit d13d5595 authored by 艾娇平's avatar 艾娇平

Merge branch 'houchaoxin/dev' into 'master'

跳转H5界面的协议解析

See merge request !7
parents f67f0528 c209bc8b
...@@ -98,12 +98,17 @@ static NSMutableDictionary *routeMap = nil; ...@@ -98,12 +98,17 @@ static NSMutableDictionary *routeMap = nil;
NSDictionary *params; NSDictionary *params;
NSArray *array = [encodeUrlScheme componentsSeparatedByString:@"url="]; NSArray *array = [encodeUrlScheme componentsSeparatedByString:@"url="];
if (([host isEqualToString:@"third_webview"] || [host isEqualToString:@"common_webview"]) && array.count > 1) { if (([host isEqualToString:@"third_webview"] || [host isEqualToString:@"common_webview"]) && array.count > 1) {
//解析其他参数
NSString *perfixStr = [array firstObject];
NSDictionary *perDict = [self urlQueryToDictionary:perfixStr];
//解析URL参数
NSString *value = array[1]; NSString *value = array[1];
//拦截所有的即将调转的url(value),如果不在白名单之中,让其使用GMThirdWebViewController加载. 必须要用while 因为url部分包含 %3A gengmei://common_webview?url=http%3A//backend.paas.env/hybrid/base_wiki/item/285 //拦截所有的即将调转的url(value),如果不在白名单之中,让其使用GMThirdWebViewController加载. 必须要用while 因为url部分包含 %3A gengmei://common_webview?url=http%3A//backend.paas.env/hybrid/base_wiki/item/285
while ([value rangeOfString:@"%"].length != 0) { while ([value rangeOfString:@"%"].length != 0) {
value = [self URLDecodedString:value]; value = [self URLDecodedString:value];
} }
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[self urlQueryToDictionary:value]]; NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[self urlQueryToDictionary:value]];
[dict setValuesForKeysWithDictionary:perDict];
[dict setValue:value forKey:@"url"]; [dict setValue:value forKey:@"url"];
params = dict; params = dict;
} else { } else {
......
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