Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
GMRouter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMRouter
Commits
8f0b8afd
Commit
8f0b8afd
authored
Aug 13, 2020
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
5b08c241
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
GMRouter+gm.m
GMRouter/Classes/GMRouter+gm.m
+6
-9
No files found.
GMRouter/Classes/GMRouter+gm.m
View file @
8f0b8afd
...
@@ -43,27 +43,24 @@ static NSMutableDictionary *routeMap = nil;
...
@@ -43,27 +43,24 @@ static NSMutableDictionary *routeMap = nil;
}
}
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
completeBlock
:
(
GMRouterBlock
)
routerBlock
{
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
completeBlock
:
(
GMRouterBlock
)
routerBlock
{
NSString
*
encodeUrlScheme
;
if
(
!
[
urlScheme
hasPrefix
:
GMRouterProtocolPrefix
])
{
if
([
encodeUrlScheme
hasPrefix
:
GMRouterProtocolPrefix
])
{
urlScheme
=
[
NSString
stringWithFormat
:
@"%@%@"
,
GMRouterProtocolPrefix
,
urlScheme
];
encodeUrlScheme
=
[
self
URLEncodeString
:
urlScheme
];
}
else
{
encodeUrlScheme
=
[
NSString
stringWithFormat
:
@"%@%@"
,
GMRouterProtocolPrefix
,
urlScheme
];
}
}
if
(
!
urlScheme
.
length
)
{
return
nil
;
}
NSString
*
encodeUrlScheme
=
[
self
URLEncodeString
:
urlScheme
];
NSDictionary
*
params
=
[
self
getParams
:
encodeUrlScheme
];
NSDictionary
*
params
=
[
self
getParams
:
encodeUrlScheme
];
return
[
self
pushScheme
:
u
rlScheme
params
:
params
completeBlock
:
routerBlock
];
return
[
self
pushScheme
:
encodeU
rlScheme
params
:
params
completeBlock
:
routerBlock
];
}
}
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
params
:
(
NSDictionary
*
)
params
completeBlock
:
(
GMRouterBlock
)
routerBlock
{
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
params
:
(
NSDictionary
*
)
params
completeBlock
:
(
GMRouterBlock
)
routerBlock
{
NSMutableDictionary
*
allParams
=
[
NSMutableDictionary
dictionaryWithDictionary
:
params
];
NSMutableDictionary
*
allParams
=
[
NSMutableDictionary
dictionaryWithDictionary
:
params
];
NSString
*
encodeUrlScheme
=
[
self
URLEncodeString
:
urlScheme
];
NSString
*
encodeUrlScheme
=
[
self
URLEncodeString
:
urlScheme
];
NSString
*
host
=
[
self
getHost
:
urlScheme
];
NSString
*
host
=
[
self
getHost
:
urlScheme
];
NSString
*
targetName
=
[
routeMap
objectForKey
:
host
];
NSString
*
targetName
=
[
routeMap
objectForKey
:
host
];
NSDictionary
*
paramsDict
=
[
self
getParams
:
encodeUrlScheme
];
NSDictionary
*
paramsDict
=
[
self
getParams
:
encodeUrlScheme
];
[
allParams
addEntriesFromDictionary
:
paramsDict
];
[
allParams
addEntriesFromDictionary
:
paramsDict
];
host
=
[
self
safeHostWithEncodeUrlScheme
:
encodeUrlScheme
host
:
host
];
host
=
[
self
safeHostWithEncodeUrlScheme
:
encodeUrlScheme
host
:
host
];
id
vc
=
[
self
performTarget
:
targetName
action
:
host
params
:
params
shouldCacheTarget
:
NO
];
id
vc
=
[
self
performTarget
:
targetName
action
:
host
params
:
params
shouldCacheTarget
:
NO
];
//如果是push 过来的 或者需要回调的在此赋值
//如果是push 过来的 或者需要回调的在此赋值
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment