Commit c209bc8b authored by 侯超鑫's avatar 侯超鑫

跳转H5界面的协议解析

parent f67f0528
......@@ -98,12 +98,17 @@ static NSMutableDictionary *routeMap = nil;
NSDictionary *params;
NSArray *array = [encodeUrlScheme componentsSeparatedByString:@"url="];
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];
//拦截所有的即将调转的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) {
value = [self URLDecodedString:value];
}
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[self urlQueryToDictionary:value]];
[dict setValuesForKeysWithDictionary:perDict];
[dict setValue:value forKey:@"url"];
params = dict;
} 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