Skip to content

Commit

Permalink
修复encode多级数组索引bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wendux committed Jan 25, 2019
1 parent 95d79f6 commit d2267a4
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 20 deletions.
8 changes: 6 additions & 2 deletions demon/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@
console.log("error", e)
})

fly.get("../package.json", {aa: 8, bb: 9, tt: {xx: 5}})
fly.get("../package.json", {
"a": "你好",
"b": [5, "6"],
"c": {"d": 8, "e": {"a": 5, "b": [66, 8]}}
})
.then(function (d) {
console.log("get result:", d)
}).catch(function (e) {
Expand Down Expand Up @@ -101,4 +105,4 @@
})
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion dist/engine-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module.exports = {
var type = that.type(sub);
if (type == "array") {
sub.forEach(function (e, i) {
if (!that.isObject(data)) i = "";
if (!that.isObject(e)) i = "";
_encode(e, path + ('%5B' + i + '%5D'));
});
} else if (type == "object") {
Expand Down
2 changes: 1 addition & 1 deletion dist/engine-wrapper.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/fly.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module.exports = {
var type = that.type(sub);
if (type == "array") {
sub.forEach(function (e, i) {
if (!that.isObject(data)) i = "";
if (!that.isObject(e)) i = "";
_encode(e, path + ('%5B' + i + '%5D'));
});
} else if (type == "object") {
Expand Down
Loading

0 comments on commit d2267a4

Please sign in to comment.