lushuncheng hace 6 años
padre
commit
45ec1cfd24
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      plugins/http.js
  2. 1 1
      plugins/nuxtAxios.js

+ 1 - 1
plugins/http.js

@@ -28,7 +28,7 @@ const post = async (path, data = {}, payload = {}) => {
   for(const key in data) {
     console.log(key)
     if(data.hasOwnProperty(key)) {
-      const element = encodeURI(data[key])
+      const element = encodeURIComponent(data[key])
       console.log(element)
       urlParams.push(`${key}=${element}`)
     }

+ 1 - 1
plugins/nuxtAxios.js

@@ -29,7 +29,7 @@ export default function ({ $axios, redirect, req, ...args }) {
               let urlParams = [];
               for(const key in data) {
                 if(data.hasOwnProperty(key)) {
-                  const element = encodeURI(data[key])
+                  const element = encodeURIComponent(data[key])
                   console.log(key)
                   console.log(element)
                   urlParams.push(`${key}=${element}`)