635ec8bf by unknown

提示运行环境

1 parent df6e4c3a
...@@ -21,11 +21,19 @@ function toJson(str) { ...@@ -21,11 +21,19 @@ function toJson(str) {
21 if(str.length > 2){ 21 if(str.length > 2){
22 var result = /\{([\s\S]*)\}/.exec(str); 22 var result = /\{([\s\S]*)\}/.exec(str);
23 } 23 }
24
24 var arr = result[1].split(',') 25 var arr = result[1].split(',')
25 var obj = {} 26 var obj = {}
26 arr.forEach(function (value) { 27 arr.forEach(function (value) {
27 var key = value.split(':')[0] 28 if(isAndroid){
28 var val = value.split(':')[1] 29 var key = value.split('=')[0]
30 var val = value.split('=')[1]
31 }
32 if(isiOS) {
33 var key = value.split(':')[0]
34 var val = value.split(':')[1]
35 }
36
29 obj[key] = val 37 obj[key] = val
30 }) 38 })
31 return obj 39 return obj
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!