소스 검색

change axios

lushuncheng 6 년 전
부모
커밋
45ec1cfd24
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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}`)