防止get请求参数值为false或0等特殊值会导致无法正确的传参

This commit is contained in:
RuoYi
2020-12-22 16:25:16 +08:00
committed by 疯狂的狮子li
parent 27533b9413
commit c2a5e94721

View File

@@ -27,7 +27,7 @@ service.interceptors.request.use(config => {
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
var part = encodeURIComponent(propName) + "=";
if (value && typeof(value) !== "undefined") {
if (value !== null && typeof(value) !== "undefined") {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
let params = propName + '[' + key + ']';