get请求params添加null值判断
This commit is contained in:
parent
ef92ad4d8c
commit
563e11d9c1
|
@ -25,7 +25,7 @@ service.interceptors.request.use(config => {
|
||||||
for (const propName of Object.keys(config.params)) {
|
for (const propName of Object.keys(config.params)) {
|
||||||
const value = config.params[propName];
|
const value = config.params[propName];
|
||||||
var part = encodeURIComponent(propName) + "=";
|
var part = encodeURIComponent(propName) + "=";
|
||||||
if (typeof(value) !== "undefined") {
|
if (value && typeof(value) !== "undefined") {
|
||||||
if (typeof value === 'object') {
|
if (typeof value === 'object') {
|
||||||
for (const key of Object.keys(value)) {
|
for (const key of Object.keys(value)) {
|
||||||
let params = propName + '[' + key + ']';
|
let params = propName + '[' + key + ']';
|
||||||
|
|
Loading…
Reference in New Issue