vue-resource进行接口请求,不简写

let self = this;
        let id=self.id;
        this.$http({
            url: ctx + '/ucenter/weixin/app/experienceApp',
            method: 'post',
            headers: {
              'X-Requested-With': 'XMLHttpRequest',
              'Content-Type': 'application/x-www-form-urlencoded'
            },
            data: Qs.stringify({
              tokenWeixin: window.localStorage.getItem("token"),
              resId:id
            }),
            responseType: 'json',
          }).then(function (response) {
            alert("接口调试成功!!!")
          },function(error){
            alert("接口调用失败!!!")
          })

猜你喜欢

转载自www.cnblogs.com/sakura-lifangfang/p/9635047.html