Skip to content

Commit 359cf70

Browse files
committed
vue: normalize also params in fetch.js
1 parent d14e543 commit 359cf70

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

templates/vue-common/utils/fetch.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ export default function(id, options = {}) {
2222
options.headers.set('Content-Type', MIME_TYPE);
2323

2424
if (options.params) {
25-
let queryString = Object.keys(options.params)
25+
const params = normalize(options.params);
26+
let queryString = Object.keys(params)
2627
.map(key =>
27-
Array.isArray(options.params[key])
28-
? makeParamArray(key, options.params[key])
29-
: `${key}=${options.params[key]}`
28+
Array.isArray(params[key])
29+
? makeParamArray(key, params[key])
30+
: `${key}=${params[key]}`
3031
)
3132
.join('&');
3233
id = `${id}?${queryString}`;

0 commit comments

Comments
 (0)