类似于这个   https://segmentfault.com/q/1010000017073493
跟这个问题一样,但是我配置了跨域 

解决方案 »

  1.   

    大佬们,https://segmentfault.com/q/1010000017073493/a-1020000017074611类似于这个问题,跪求
      

  2.   


    export const postRequest = (url, params) => {
      return axios({
        method: 'post',
        url: `${base}${url}`,
        data: params,
        transformRequest: [function (data) {
          let ret = ''
          for (let it in data) {
            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
          }
          return ret
        }],
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          "withCredentials": true
        }
      });
      }