Преглед изворни кода

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

RuoYi пре 5 година
родитељ
комит
79472708d9
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      ruoyi-ui/src/utils/request.js

+ 1 - 1
ruoyi-ui/src/utils/request.js

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