Commit 8f0b8afd authored by jz's avatar jz

update

parent 5b08c241
......@@ -43,27 +43,24 @@ static NSMutableDictionary *routeMap = nil;
}
- (id)pushScheme:(NSString *)urlScheme completeBlock:(GMRouterBlock)routerBlock {
NSString *encodeUrlScheme;
if ([encodeUrlScheme hasPrefix:GMRouterProtocolPrefix]) {
encodeUrlScheme = [self URLEncodeString:urlScheme];
} else {
encodeUrlScheme = [NSString stringWithFormat:@"%@%@", GMRouterProtocolPrefix ,urlScheme];
if (![urlScheme hasPrefix:GMRouterProtocolPrefix]) {
urlScheme = [NSString stringWithFormat:@"%@%@", GMRouterProtocolPrefix ,urlScheme];
}
if (!urlScheme.length) { return nil; }
NSString *encodeUrlScheme = [self URLEncodeString:urlScheme];
NSDictionary *params = [self getParams:encodeUrlScheme];
return [self pushScheme:urlScheme params:params completeBlock:routerBlock];
return [self pushScheme:encodeUrlScheme params:params completeBlock:routerBlock];
}
- (id)pushScheme:(NSString *)urlScheme params:(NSDictionary *)params completeBlock:(GMRouterBlock)routerBlock {
NSMutableDictionary *allParams = [NSMutableDictionary dictionaryWithDictionary:params];
NSString *encodeUrlScheme = [self URLEncodeString:urlScheme];
NSString *host = [self getHost:urlScheme];
NSString *targetName = [routeMap objectForKey:host];
NSDictionary *paramsDict = [self getParams:encodeUrlScheme];
[allParams addEntriesFromDictionary:paramsDict];
host = [self safeHostWithEncodeUrlScheme:encodeUrlScheme host:host];
id vc = [self performTarget:targetName action:host params:params shouldCacheTarget:NO];
//如果是push 过来的 或者需要回调的在此赋值
......
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