axios.get('https://foobar.com/api', { paramsSerializer: function(params) { var result = ''; // Build the query string return result; } });
或者全局设置
var instance = axios.create({ paramsSerializer: function(params) { /* ... */ } })
axios.defaults.paramsSerializer = function(params) { /* ... */ };
或者把key直接加在url上
axios.get('https://foobar.com/api?api_key=' + key);
axios.get('https://foobar.com/api?api_key=' + key, { params: { foo: 'bar' } });