浏览代码

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}`)