$axios 传递object Converting circular structure to JSON

跟踪了一天的代码,最终找到了问题:
 
注意在开发工具中跟踪data对象中每个变量的值,最开始是将customize_name2....写成了对象,而不是取input的值,造成的问题。
以下为正确写法:
<Input size="large" v-model="customize_name2" name="customize_name2" placeholder="请填写手机号" class="input_style" />
 
var data = { 
              trace_code:sessionStorage.getItem("code"),
              customer_id:sessionStorage.getItem("customerId"),
              code:sessionStorage.getItem("code"),
              customize_name2:t.customize_name2,
              customize_name1:t.customize_name1,
              customize_name3:t.customize_name3
              };

        t.$axios.get(baseUrl + "/index/user/collect_info",{
        params:data
        })
        .then(function (s) {
            console.log(s)
            debugger
            //t.modal_loading = false;
            // 200 == s.data.code
            //   ? ((t.collection = !t.collection), t.join())
            //   : t.$Toast(s.data.msg);
            if(200 == s.data.code){
              t.collection=false
              t.handleStatus()//重新抽奖
            }
          })
        .catch(function (err) {
          //t.$Toast("网络异常");
          console.log(err)
        });
原文地址:https://www.cnblogs.com/gougou1981/p/14603032.html