Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
dy-wx2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
635ec8bf
authored
2018-09-02 18:56:11 +0800
by
unknown
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提示运行环境
1 parent
df6e4c3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
js/JSBridge.js
js/JSBridge.js
View file @
635ec8b
...
...
@@ -21,11 +21,19 @@ function toJson(str) {
if
(
str
.
length
>
2
){
var
result
=
/
\{([\s\S]
*
)\}
/
.
exec
(
str
);
}
var
arr
=
result
[
1
].
split
(
','
)
var
obj
=
{}
arr
.
forEach
(
function
(
value
)
{
var
key
=
value
.
split
(
':'
)[
0
]
var
val
=
value
.
split
(
':'
)[
1
]
if
(
isAndroid
){
var
key
=
value
.
split
(
'='
)[
0
]
var
val
=
value
.
split
(
'='
)[
1
]
}
if
(
isiOS
)
{
var
key
=
value
.
split
(
':'
)[
0
]
var
val
=
value
.
split
(
':'
)[
1
]
}
obj
[
key
]
=
val
})
return
obj
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment