How does the axios parameter convert illegal [] characters?

backend parameters need to convert the [] character before they can be accessed, and [convert to% 5B,] to% 5D

.

No pre-conversion

methods: {
    logicQueryData() {
        let str = JSON.stringify(this.taskArr);
        let paramsData = {
                table: this.value,
                andOr: this.queryOne,
                params: str
          };
       // 
       console.log("paramsData", paramsData);
    }
    this.$http
          .get(this.$api.logicalSearch + "logic", {
            params: paramsData
          })
          .then(res => {
              
          }
}

clipboard.png

clipboard.png


clipboard.png

Apr.22,2021

introduce qs to deal with the params, of get. Note that table first uses JSON.stringify to deal with


axiosparams %5B[

function encode(val) {
      return encodeURIComponent(val).
        replace(/%40/gi, '@').
        replace(/%3A/gi, ':').
        replace(/%24/g, '$').
        replace(/%2C/gi, ',').
        replace(/%20/g, '+').
        replace(/%5B/gi, '[').
        replace(/%5D/gi, ']');
    }
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e529c4-451c8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e529c4-451c8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?